summaryrefslogtreecommitdiffstats
path: root/tdeio
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-01-29 23:33:37 +0900
committerMichele Calgaro <[email protected]>2020-01-30 11:36:47 +0900
commitd46ec74e775617b150c3f54812e9ec203e3c727e (patch)
tree12f4c0c0d72de99a556752434cca69b630fd2cfa /tdeio
parentea1da131d3eda406c2775a9b538a3e3cbd581007 (diff)
downloadtdelibs-d46ec74e775617b150c3f54812e9ec203e3c727e.tar.gz
tdelibs-d46ec74e775617b150c3f54812e9ec203e3c727e.zip
Make sure XDG folders are created prior to their usage.
Signed-off-by: Michele Calgaro <[email protected]> (cherry picked from commit de79e754fa8118d34ea804d6b4fb7056b65487fd)
Diffstat (limited to 'tdeio')
-rw-r--r--tdeio/tdefile/tdefilespeedbar.cpp44
1 files changed, 17 insertions, 27 deletions
diff --git a/tdeio/tdefile/tdefilespeedbar.cpp b/tdeio/tdefile/tdefilespeedbar.cpp
index 635474122..bce229c4c 100644
--- a/tdeio/tdefile/tdefilespeedbar.cpp
+++ b/tdeio/tdefile/tdefilespeedbar.cpp
@@ -44,37 +44,27 @@ KFileSpeedBar::KFileSpeedBar( TQWidget *parent, const char *name )
if ( m_initializeSpeedbar )
{
- KURL u;
- u.setPath( TDEGlobalSettings::desktopPath() );
- insertItem( u, i18n("Desktop"), false );
-
-//TODO: win32
- if ((TDEGlobalSettings::documentPath() != (TQDir::homeDirPath()+"/")) &&
- TQDir(TDEGlobalSettings::documentPath()).exists())
+ insertItem(TQDir::homeDirPath(), i18n("Home Folder"), false, "folder_home");
+ insertItem(TDEGlobalSettings::desktopPath(), i18n("Desktop"), false, "folder_txt");
+ insertItem(TDEGlobalSettings::documentPath(), i18n("Documents"), false, "folder_txt");
+ insertItem(TDEGlobalSettings::downloadPath(), i18n( "Downloads" ), false, "folder_html");
+ insertItem(TDEGlobalSettings::musicPath(), i18n( "Music" ), false, "folder_sound");
+ insertItem(TDEGlobalSettings::picturesPath(), i18n( "Pictures" ), false, "folder_image");
+ insertItem(TDEGlobalSettings::publicSharePath(), i18n( "Public" ), false, "folder");
+ insertItem(TDEGlobalSettings::templatesPath(), i18n( "Templates" ), false, "folder_txt");
+ insertItem(TDEGlobalSettings::videosPath(), i18n( "Videos" ), false, "folder_video");
+
+ KURL u = "media:/";
+ if (KProtocolInfo::isKnownProtocol(u))
{
- u.setPath( TDEGlobalSettings::documentPath() );
- insertItem( u, i18n("Documents"), false, "folder_txt" );
+ insertItem(u, i18n("Storage Media"), false, KProtocolInfo::icon("media"));
}
- u.setPath( TQDir::homeDirPath() );
- insertItem( u, i18n("Home Folder"), false, "folder_home" );
-
- u = "media:/";
- if ( KProtocolInfo::isKnownProtocol( u ) )
- insertItem( u, i18n("Storage Media"), false, KProtocolInfo::icon( "media" ) );
-
- // now add in the speedbar
- insertItem(TDEGlobalSettings::downloadPath(), i18n( "Downloads" ), false, "folder_html" );
- insertItem(TDEGlobalSettings::musicPath(), i18n( "Music" ), false, "folder_sound" );
- insertItem(TDEGlobalSettings::picturesPath(), i18n( "Pictures" ), false, "folder_image" );
- insertItem(TDEGlobalSettings::publicSharePath(), i18n( "Public" ), false, "folder" );
- insertItem(TDEGlobalSettings::templatesPath(), i18n( "Templates" ), false, "folder" );
- insertItem(TDEGlobalSettings::videosPath(), i18n( "Videos" ), false, "folder_video" );
-
u = "remote:/";
- if ( KProtocolInfo::isKnownProtocol( u ) )
- insertItem( u, i18n("Network Folders"), false,
- KProtocolInfo::icon( "remote" ) );
+ if (KProtocolInfo::isKnownProtocol(u))
+ {
+ insertItem(u, i18n("Network Folders"), false, KProtocolInfo::icon("remote"));
+ }
}
}