[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kdecore/kernel
From: Andreas Holzammer <andy () kdab ! com>
Date: 2010-07-20 14:18:56
Message-ID: 20100720141856.B6C43AC76D () svn ! kde ! org
[Download RAW message or body]
SVN commit 1152202 by aholzammer:
- changed readEnvPath for wince
- readEnvPath gets the info from the registry \\HKLM\Software\kde
M +1 -1 kkernel_win.cpp
M +6 -0 kkernel_win.h
M +14 -2 kstandarddirs.cpp
--- trunk/KDE/kdelibs/kdecore/kernel/kkernel_win.cpp #1152201:1152202
@@ -145,7 +145,7 @@
@param item is an item inside subKey or "" if default folder's value should be returned
@param ok if not null, will be set to true on success and false on failure
*/
-QString getWin32RegistryValue ( HKEY key, const QString& subKey, const QString& item, bool *ok = 0 )
+QString getWin32RegistryValue ( HKEY key, const QString& subKey, const QString& item, bool *ok )
{
#define FAILURE \
{ if (ok) \
--- trunk/KDE/kdelibs/kdecore/kernel/kkernel_win.h #1152201:1152202
@@ -19,6 +19,8 @@
#ifndef KKERNEL_WIN_H
#define KKERNEL_WIN_H
+#include <winbase.h>
+
#include <QtCore/QString>
#ifdef Q_OS_WIN
@@ -58,6 +60,10 @@
*/
KDECORE_EXPORT bool isExecutable(const QString &filename);
+/**
+ \return a value from MS Windows native registry.
+*/
+QString getWin32RegistryValue ( HKEY key, const QString& subKey, const QString& item, bool *ok = 0 );
#endif // Q_OS_WIN
#endif // KKERNEL_WIN_H
--- trunk/KDE/kdelibs/kdecore/kernel/kstandarddirs.cpp #1152201:1152202
@@ -1593,9 +1593,21 @@
static QString readEnvPath(const char *env)
{
- QByteArray c_path = qgetenv(env);
+ QByteArray c_path;
+#ifndef _WIN32_WCE
+ c_path = qgetenv(env);
if (c_path.isEmpty())
return QString();
+#else
+ bool ok;
+ QString retval;
+ getWin32RegistryValue(HKEY_LOCAL_MACHINE, "Software\\kde", retval, &ok);
+ if (!ok){
+ return QString();
+ } else {
+ c_path = retval.toAscii();
+ }
+#endif
return QDir::fromNativeSeparators(QFile::decodeName(c_path));
}
@@ -1651,9 +1663,9 @@
addResourcesFrom_krcdirs();
QStringList kdedirList;
-
// begin KDEDIRS
QString kdedirs = readEnvPath("KDEDIRS");
+
if (!kdedirs.isEmpty())
{
tokenize(kdedirList, kdedirs, QString(QChar(KPATH_SEPARATOR)));
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic