[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-25 Thread Kai Uwe Broulik
broulik added inline comments.

INLINE COMMENTS

> dfaure wrote in iconapplet.cpp:108
> Not convinced that KIO::encodeFileName would be better than a MD5 filename, 
> then?

Ah, that's what you meant with that. I got confused as to where and why I 
should use this … so, will work for when there's no fileName? Then I can just 
use that indeed.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas


[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-24 Thread David Faure
dfaure added inline comments.

INLINE COMMENTS

> iconapplet.cpp:108
> +if (desiredDesktopFileName.isEmpty()) {
> +desiredDesktopFileName = 
> QString::fromLatin1(QCryptographicHash::hash(m_url.toDisplayString().toUtf8(),
>  QCryptographicHash::Md5).toHex());
> +}

Not convinced that KIO::encodeFileName would be better than a MD5 filename, 
then?

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas


[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-24 Thread Kai Uwe Broulik
broulik added a comment.


  So, should we go with this now?

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas


[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-19 Thread David Faure
dfaure added a comment.


  What I used to do about all this is to turn every '/' into a unicode fraction 
slash (so that it still looks like a '/' to the user, but can be used in a 
filename), and name the link with the full URL like 
"ftp://www.somehost.com/foo/bar/;.
  
  See KIO::encodeFileName (and copyjob.cpp:813, i.e. if you use KIO::link() 
this happens automatically in KIO).
  
  But maybe that's because I like URLs :-)

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas


[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-19 Thread Kai Uwe Broulik
broulik added a comment.


  Ok, I'll put it after
  
if (name.isEmpty()) {
name = url.path();
}
  
  and do a
  
if (name.isEmpty() || url.scheme().startsWith(QLatin1String("http"))) {
name = url.host();
}

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas


[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-19 Thread David Faure
dfaure added a comment.


  But then every HTTP URL, even with a filename, will the host as filename? 
  Useful if you have only one link to a given website, but what if you have 5 
links to different pages on that website?
  
  Or maybe I didn't understand the order you wanted to use.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas


[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-19 Thread Kai Uwe Broulik
broulik added inline comments.

INLINE COMMENTS

> dfaure wrote in iconapplet.cpp:159
> No, not necessarily. You can point to the root of a FTP server with 
> ftp://ftp.kde.org/  and you can even point to your home dir on an FTP server 
> with ftp://user@host (and no trailing slash).
> 
> Similarly there's smb://workgroup or smb://host (I forgot the exact syntax 
> for workgroups), no filename.
> 
> Why not handle any case without a filename in the same way, http or not?

I see. Still when I do http://www.kde.org/index.php I would get "index.php" as 
name which is non-descript.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas


[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-19 Thread David Faure
dfaure added inline comments.

INLINE COMMENTS

> broulik wrote in iconapplet.cpp:159
> There you would usually have a filename that makes sense.

No, not necessarily. You can point to the root of a FTP server with 
ftp://ftp.kde.org/  and you can even point to your home dir on an FTP server 
with ftp://user@host (and no trailing slash).

Similarly there's smb://workgroup or smb://host (I forgot the exact syntax for 
workgroups), no filename.

Why not handle any case without a filename in the same way, http or not?

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas


[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-19 Thread Kai Uwe Broulik
broulik added inline comments.

INLINE COMMENTS

> dfaure wrote in iconapplet.cpp:159
> Why only http?
> 
> This would be useful for FTP, SMB and many other things, no?

There you would usually have a filename that makes sense.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas


[Differential] [Commented On] D4157: [Icon Applet] Use KIO::statJob to work with remote URLs

2017-01-19 Thread David Faure
dfaure added inline comments.

INLINE COMMENTS

> iconapplet.cpp:159
>  
> -return;
> +if (name.isEmpty() && 
> url.scheme().startsWith(QLatin1String("http"))) {
> +name = url.host();

Why only http?

This would be useful for FTP, SMB and many other things, no?

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D4157

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, #plasma, mart, dfaure
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas