summaryrefslogtreecommitdiff
blob: 614ee87253a6c0768bebd5e5543758f4026bf715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
KDE is smart, too smart. We don't want application bundles. And since our Qt is
configured to not build application bundles, since wouldn't even work. So this
patch disables KDE's smartness regarding application bundles.

Author: Heiko Przybyl <zuxez@cs.tu-berlin.de>

--- kdelibs-4.3.1/kdecore/kernel/kstandarddirs.cpp.orig	2009-09-28 02:05:37 +0200
+++ kdelibs-4.3.1/kdecore/kernel/kstandarddirs.cpp	2009-09-28 02:22:20 +0200
@@ -1327,14 +1303,6 @@ int KStandardDirs::findAllExe( QStringLi
         p = (*it) + '/';
         p += real_appname;
 
-#ifdef Q_WS_MAC
-        QString bundle = getBundle( p, (options & IgnoreExecBit) );
-        if ( !bundle.isEmpty() ) {
-            //kDebug(180) << "findExe(): returning " << bundle;
-            list.append( bundle );
-        }
-#endif
-
         info.setFile( p );
 
         if( info.exists() && ( ( options & IgnoreExecBit ) || info.isExecutable())
@@ -1636,18 +1604,6 @@ void KStandardDirs::addKDEDefaults()
         addPrefix(localKdeDir);
     }
 
-#ifdef Q_WS_MACX
-    // Adds the "Contents" directory of the current application bundle to
-    // the search path. This way bundled resources can be found.
-    QDir bundleDir(mac_app_filename());
-    if (bundleDir.dirName() == "MacOS") { // just to be sure we're in a bundle
-        bundleDir.cdUp();
-        // now dirName should be "Contents". In there we can find our normal
-        // dir-structure, beginning with "share"
-        addPrefix(bundleDir.absolutePath());
-    }
-#endif
-
     QStringList::ConstIterator end(kdedirList.end());
     for (QStringList::ConstIterator it = kdedirList.constBegin();
          it != kdedirList.constEnd(); ++it)
@@ -1680,11 +1636,7 @@ void KStandardDirs::addKDEDefaults()
     }
     else
     {
-#ifdef Q_WS_MACX
-        localXdgDir =  QDir::homePath() + "/Library/Preferences/XDG/";
-#else
         localXdgDir =  QDir::homePath() + "/.config/";
-#endif
     }
 
     localXdgDir = KShell::tildeExpand(localXdgDir);
--- ./kinit/kinit.cpp.orig	2009-09-28 12:38:02 +0200
+++ ./kinit/kinit.cpp	2009-09-28 12:40:02 +0200
@@ -551,14 +551,7 @@ static pid_t launch(int argc, const char
        QByteArray procTitle;
        d.argv = (char **) malloc(sizeof(char *) * (argc+1));
        d.argv[0] = (char *) _name;
-#ifdef Q_WS_MAC
-       QString argvexe = s_instance->dirs()->findExe(QString::fromLatin1(d.argv[0]));
-       if (!argvexe.isEmpty()) {
-          QByteArray cstr = argvexe.toLocal8Bit();
-          kDebug(7016) << "kdeinit4: launch() setting argv: " << cstr.data();
-          d.argv[0] = strdup(cstr.data());
-       }
-#endif
+
        for (int i = 1;  i < argc; i++)
        {
           d.argv[i] = (char *) args;
@@ -627,12 +620,6 @@ static pid_t launch(int argc, const char
         setup_tty( tty );
 
         QByteArray executable = execpath;
-#ifdef Q_WS_MAC
-        QString bundlepath = s_instance->dirs()->findExe(QFile::decodeName(executable));
-        if (!bundlepath.isEmpty())
-           executable = QFile::encodeName(bundlepath);
-#endif
-
         if (!executable.isEmpty())
            execvp(executable, d.argv);
 
--- kdelibs-9999/kdecore/kernel/kstandarddirs.cpp.orig	2010-03-06 15:47:40.108111613 +0100
+++ kdelibs-9999/kdecore/kernel/kstandarddirs.cpp	2010-03-06 23:17:01.853905357 +0100
@@ -1207,41 +1207,8 @@
     return exePaths;
 }
 
-#ifdef Q_WS_MAC
-static QString getBundle( const QString& path, bool ignore )
-{
-    kDebug(180) << "getBundle(" << path << ", " << ignore << ") called";
-    QFileInfo info;
-    QString bundle = path;
-    bundle += ".app/Contents/MacOS/" + bundle.section('/', -1);
-    info.setFile( bundle );
-    FILE *file;
-    if (file = fopen(info.absoluteFilePath().toUtf8().constData(), "r")) {
-        fclose(file);
-        struct stat _stat;
-        if ((stat(info.absoluteFilePath().toUtf8().constData(), &_stat)) < 0) {
-            return QString();
-        }
-        if ( ignore || (_stat.st_mode & S_IXUSR) ) {
-            if ( ((_stat.st_mode & S_IFMT) == S_IFREG) || ((_stat.st_mode & S_IFMT) == S_IFLNK) ) {
-                kDebug(180) << "getBundle(): returning " << bundle;
-                return bundle;
-            }
-        }
-    }
-    return QString();
-}
-#endif
-
 static QString checkExecutable( const QString& path, bool ignoreExecBit )
 {
-#ifdef Q_WS_MAC
-    QString bundle = getBundle( path, ignoreExecBit );
-    if ( !bundle.isEmpty() ) {
-        //kDebug(180) << "findExe(): returning " << bundle;
-        return bundle;
-    }
-#endif
     QFileInfo info( path );
     QFileInfo orig = info;
 #if defined(Q_OS_DARWIN) || defined(Q_OS_MAC)