~ubuntu-branches/ubuntu/quantal/kde4libs/quantal

« back to all changes in this revision

Viewing changes to debian/patches/findservicebydesktoppath_try_realfilepath.diff

  • Committer: Package Import Robot
  • Author(s): Felix Geyer, Philip Muškovac, Jonathan Thomas, Felix Geyer
  • Date: 2011-05-29 17:19:55 UTC
  • mfrom: (1.14.5 upstream) (0.1.19 sid)
  • Revision ID: package-import@ubuntu.com-20110529171955-nodep1593tuwyu6k
Tags: 4:4.6.3-1ubuntu1
[ Philip Muškovac]
* Drop kubuntu_83_fix_solid_network_status.diff
* Update Vcs links as the branch is owned by kubuntu-packagers now

[ Jonathan Thomas ]
* Drop kubuntu_06_user_disk_mounting. We no longer compile the hal
  backend, so this patch is useless.

[ Felix Geyer ]
* Merge from Debian unstable, remaining changes:
  - no build-dep on libaspell-dev
  - no build-dep on libfam-dev
  - kdelibs5-data: don't install kspell_aspell.desktop and
    usr/lib/kde4/kspell_aspell.so
  - kdelibs5-dev: don't install preparetips
  - Pass -DKDESU_USE_SUDO_DEFAULT=true to configure
  - dh_fixperms: exclude /usr/lib/kde4/libexec/fileshareset
  - set export KUBUNTU_DESKTOP_POT=kdelibs
  - don't apply use_dejavu_as_default_font.diff
  - don't apply kconf_update_migrate_from_kde3_icon_theme.diff
    - kdelibs5-data.install: drop usr/share/kde4/apps/kconf_update/kdeui.upd
  - don't build depend on libglu1-mesa-dev, not needed due to
    kubuntu_no_direct_gl_usage.diff
  - Add kdelibs5-data.links: link from /usr/share/doc/kde4 to kde for
    backwards compatible with old docs location
  - Keep the kdelibs5 transitional package
  - kdelibs5-dev.install: install ksambasharedata.h
  - kdelibs5-plugins: recommend ttf-dejavu-core instead of ttf-dejavu to save
    CD space.
* Add Breaks in addition to Replaces for moving files between packages.
* Drop no longer needed Breaks and Replaces.
* Completely drop kubuntu_51_launchpad_integration.diff and
  kubuntu_68_remove_applet_confirmation.diff.
  + Also drop the launchpad and kubuntu icons.
* Remove sequence numbers from kubuntu patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
This patch is an attempt to make KDE find desktop files
 
2
and other stuff when /usr or anything else in the file
 
3
path is a symlink.
 
4
--- a/kdecore/services/kservicefactory.cpp
 
5
+++ b/kdecore/services/kservicefactory.cpp
 
6
@@ -124,22 +124,16 @@ KService::Ptr KServiceFactory::findServi
 
7
     return newService;
 
8
 }
 
9
 
 
10
-KService::Ptr KServiceFactory::findServiceByDesktopPath(const QString &_name)
 
11
+KService::Ptr KServiceFactory::serviceFromPath(const QString &_name)
 
12
 {
 
13
-    if (!m_relNameDict) return KService::Ptr(); // Error!
 
14
-
 
15
-    // Warning : this assumes we're NOT building a database
 
16
-    // KBuildServiceFactory reimplements it for the case where we are building one
 
17
-
 
18
     int offset = m_relNameDict->find_string( _name );
 
19
     if (!offset) {
 
20
-        //kDebug(servicesDebugArea()) << "findServiceByDesktopPath:" << _name << "not found";
 
21
         return KService::Ptr(); // Not found
 
22
     }
 
23
 
 
24
     KService::Ptr newService(createEntry(offset));
 
25
     if (!newService) {
 
26
-        kDebug(servicesDebugArea()) << "findServiceByDesktopPath: createEntry failed!";
 
27
+        kDebug(servicesDebugArea()) << "serviceFromPath: createEntry failed!";
 
28
     }
 
29
     // Check whether the dictionary was right
 
30
     // It's ok that it's wrong, for the case where we're looking up an unknown service,
 
31
@@ -150,6 +144,27 @@ KService::Ptr KServiceFactory::findServi
 
32
     }
 
33
     return newService;
 
34
 }
 
35
+
 
36
+KService::Ptr KServiceFactory::findServiceByDesktopPath(const QString &_name)
 
37
+{
 
38
+    if (!m_relNameDict) return KService::Ptr(); // Error!
 
39
+
 
40
+    // Warning : this assumes we're NOT building a database
 
41
+    // KBuildServiceFactory reimplements it for the case where we are building one
 
42
+
 
43
+    KService::Ptr newService(serviceFromPath(_name));
 
44
+    if (!newService) {
 
45
+        // We might have been given a symlink or non-canonical path of some sort.
 
46
+        // Therefore try looking up KStandardDirs::realFilePath'ed path too.
 
47
+        newService = serviceFromPath(KStandardDirs::realFilePath(_name));
 
48
+    }
 
49
+
 
50
+    if (!newService) {
 
51
+        kDebug(servicesDebugArea()) << _name << "not found";
 
52
+        return KService::Ptr(); // Not found
 
53
+    }
 
54
+    return newService;
 
55
+}
 
56
 
 
57
 KService::Ptr KServiceFactory::findServiceByMenuId(const QString &_menuId)
 
58
 {
 
59
--- a/kdecore/services/kservicefactory.h
 
60
+++ b/kdecore/services/kservicefactory.h
 
61
@@ -121,6 +121,8 @@ protected:
 
62
     virtual void virtual_hook( int id, void* data );
 
63
 private:
 
64
     class KServiceFactoryPrivate* d;
 
65
+
 
66
+    KService::Ptr serviceFromPath(const QString &_name);
 
67
 };
 
68
 
 
69
 #endif