~ubuntu-branches/ubuntu/oneiric/kdelibs/oneiric

« back to all changes in this revision

Viewing changes to kio/kfile/kfilespeedbar.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-10-15 19:20:42 UTC
  • mfrom: (1.1.19 sid)
  • Revision ID: james.westby@ubuntu.com-20101015192042-jv1fhj33n4f5b398
Tags: 4:3.5.10.dfsg.1-5ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - make sure control and control.in are in sync
  - --with-distribution="Kubuntu (`lsb_release --codename --short`)
    $(DEB_VERSION)"
  - binary-install/kdelibs-data installs aboutkde-kubuntu.png.uu and
    cr*-device-system.png.uu
  - don't build-dep on libgamin-dev, libfam-dev
  - stop kdelibs4-dev depending on gamin/fam
  - don't install .svgz icons, docs or all_languages in kdelibs-data.install
  - rosetta support in rules common-install-prehook-impl:: [and
    common-post-build-arch:: ?] and include debian/kubuntu-desktop-i18n/
  - build-dep on: gettext-kde, kdesdk-scripts, lsb-release, base-files, sudo
  - cdbs build-dep 0.4.41ubuntu2
  - kdelibs4-dev depends on gettext-kde, kdesdk-scripts
  - copy debian/icons over
  - Make kdelibs4c2a depend on launchpad-integration, sudo.  Recommends on
    xdg-user-dirs
  - Remove 19_debianize_useragent.diff (changed to
    kubuntu_19_debianize_useragent.diff) s/Debian/Kubuntu
  - remove kdelibs4c2a depends on menu-xdg
  - include kubuntu_01_kdepot.diff and kde.pot in debian/patches/common
  - use a local copy of kde.mk without the common-install-prehook-impl::
    rule; edit debian-qt-kde.mk to include debian/cdbs/kde.mk
  - build with --with-sudo-kdesu-backend and build-dep on sudo and make
    kdelibs4c2a depend on sudo
  - kdelibs-data.install : Add nzb mimetype
  - Make kdelibs4-dev replace more recent kdelibs4c2a for overlapping files
  - remove /usr/bin/preparetips, arts files and ksvntopng from
    kdelibs4-dev.install
  - Drop the package kdelibs4-doc completely. It contained API documentation
    which is now obsolete, but still available via api.kde.org.
  - make sure control and control.in are in sync
  - in debian/rule remove .pot files outside .po directory
  - 97_automake_cleanup.diff becomes kubuntu_97_automake_cleanup.diff
  - Remove libarts1-dev from build-depends and kdelibs4-dev depends from
    control.in
* Drop kubuntu_98_fix_khc_invocation.diff, replaced by
  68_support_khelpcenter4.diff
* Drop kubuntu_97_automake_cleanup.diff, replaced by 97_automake_cleanup.diff
* Re-add security_05_XMLHttpRequest_vulnerability.diff which has been
  accidentally dropped
* Fix FTBFS, in debian/rules:
  - Add -Wl,--add-needed to LDFLAGS
  - Disable parallel building

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include "config-kfile.h"
21
21
 
22
22
#include <qdir.h>
 
23
#include <qfile.h>
 
24
#include <qtextcodec.h>
 
25
#include <qtextstream.h>
23
26
 
24
27
#include <kconfig.h>
25
28
#include <kglobal.h>
50
53
            QDir(KGlobalSettings::documentPath()).exists())
51
54
        {
52
55
            u.setPath( KGlobalSettings::documentPath() );
53
 
            insertItem( u, i18n("Documents"), false, "document" );
 
56
            insertItem( u, i18n("Documents"), false, "folder_txt" );
54
57
        }
55
58
 
56
59
        u.setPath( QDir::homeDirPath() );
62
65
            insertItem( u, i18n("Storage Media"), false,
63
66
                                   KProtocolInfo::icon( "media" ) );
64
67
 
 
68
        if (  QFile::exists(  QDir::homeDirPath()+"/.config/user-dirs.dirs" ) )
 
69
        {
 
70
                        QString download, music, pictures, videos, templates, publicShares;
 
71
 
 
72
            QFile f(  QDir::homeDirPath()+"/.config/user-dirs.dirs" );
 
73
                        if (!f.open(IO_ReadOnly))
 
74
                                return;
 
75
 
 
76
                        QTextStream s( &f );
 
77
                        s.setCodec( QTextCodec::codecForLocale() );
 
78
 
 
79
                        // read the xdg user dirs
 
80
                        QString line = s.readLine();
 
81
                        while (!line.isNull())
 
82
                        {
 
83
                                if (line.startsWith("XDG_DOWNLOAD_DIR="))
 
84
                                        download = line.remove("XDG_DOWNLOAD_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
 
85
                                else if (line.startsWith("XDG_MUSIC_DIR="))
 
86
                                        music = line.remove("XDG_MUSIC_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
 
87
                                else if (line.startsWith("XDG_PICTURES_DIR="))
 
88
                                        pictures = line.remove("XDG_PICTURES_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
 
89
                                else if (line.startsWith("XDG_VIDEOS_DIR="))
 
90
                                        videos = line.remove("XDG_VIDEOS_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
 
91
                                else if (line.startsWith("XDG_TEMPLATES_DIR="))
 
92
                                        templates = line.remove("XDG_TEMPLATES_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
 
93
                                else if (line.startsWith("XDG_PUBLICSHARES_DIR="))
 
94
                                        publicShares = line.remove("XDG_PUBLICSHARES_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
 
95
 
 
96
                                line = s.readLine();
 
97
                        }
 
98
                        // now add in the speedbar
 
99
                        if (!download.isEmpty())
 
100
                insertItem( download, i18n( "Download" ), false, "folder_html" );
 
101
                        if (!music.isEmpty())
 
102
                insertItem( music, i18n( "Music" ), false, "folder_sound" );
 
103
                        if (!pictures.isEmpty())
 
104
                insertItem( pictures, i18n( "Pictures" ), false, "folder_image" );
 
105
                        if (!videos.isEmpty())
 
106
                insertItem( videos, i18n( "Videos" ), false, "folder_video" );
 
107
                        if (!templates.isEmpty())
 
108
                insertItem( templates, i18n( "Templates" ), false, "folder_video" );
 
109
                        if (!publicShares.isEmpty())
 
110
                insertItem( publicShares, i18n( "Public" ), false, "folder_video" );
 
111
        }
 
112
        
65
113
        u = "remote:/";
66
114
        if ( KProtocolInfo::isKnownProtocol( u ) )
67
115
            insertItem( u, i18n("Network Folders"), false,