[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kde4_kconfig
From: Thomas Braxton <brax108 () cox ! net>
Date: 2006-11-19 4:42:53
Message-ID: 1163911373.657468.27977.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 606042 by braxton:
fix compile errors after merge
M +7 -4 kconfig/kconfig.h
M +13 -35 kconfig/kconfigini.cpp
M +1 -1 kdebug.cpp
M +2 -1 kglobalsettings.cpp
M +2 -1 kglobalsettings.h
M +1 -1 kicontheme.cpp
M +5 -4 klocale.cpp
M +8 -8 knotifyclient.cpp
M +1 -1 kservice/kplugininfo.cpp
M +1 -1 kservice/kservice.cpp
M +2 -3 kstandarddirs.cpp
--- branches/work/kde4_kconfig/kconfig/kconfig.h #606041:606042
@@ -64,15 +64,18 @@
};
Q_DECLARE_FLAGS(OpenFlags, OpenFlag)
- explicit KConfig(const QString& file = QString(), OpenFlags mode = \
ReadWrite|WantGlobals,
- const char* resourceType = "config", const QString& backend = \
QString()); + explicit KConfig(const QString& file = QString(),
+ OpenFlags mode = OpenFlags(ReadWrite|WantGlobals),
+ const char* resourceType = "config",
+ const QString& backend = QString());
/*
* used to specify a backend
*/
- explicit KConfig(KConfigBackend *backend, OpenFlags mode = \
ReadWrite|WantGlobals); + explicit KConfig(KConfigBackend *backend,
+ OpenFlags mode = OpenFlags(ReadWrite|WantGlobals));
- KConfig( const KConfig& config );
+ KConfig(const KConfig& config);
virtual ~KConfig();
virtual void sync(bool merge=true);
--- branches/work/kde4_kconfig/kconfig/kconfigini.cpp #606041:606042
@@ -333,46 +333,24 @@
}
}
- KSaveFile *pConfigFile = 0;
- QFile *file = 0;
+ KSaveFile file( filename );
+ if (!file.open())
+ return false;
- if (createNew) {
- pConfigFile = new KSaveFile( filename, 0600 );
+ if (createNew)
+ file.setPermissions(QFile::ReadUser|QFile::WriteUser);
- if (pConfigFile->status() != 0) {
- delete pConfigFile;
- return false;
- }
-
- if (fileMode != -1)
- fchmod(pConfigFile->handle(), fileMode);
-
- file = pConfigFile->file();
- } else {
- // Open existing file.
- file = new QFile(filename);
- if (!file->open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Text))
- {
- delete file;
- return false;
- }
- }
-
- QTextStream out(file);
+ QTextStream out(&file);
out.setCodec("UTF-8");
writeEntries(out, tempMap);
+ out.setDevice(0);
- if (pConfigFile) {
- if ( !file->size() && ((fileMode == -1) || (fileMode == 0600)) ) {
- // File is empty and doesn't have special permissions: delete it.
- QFile::remove(filename);
- pConfigFile->abort();
- } else {
- // Normal case: Close the file
- pConfigFile->close();
- out.setDevice(0);
- }
- delete pConfigFile;
+ if ( !file.size() && ((fileMode == -1) || (fileMode == 0600)) ) {
+ // File is empty and doesn't have special permissions: delete it.
+ file.abort();
+ } else {
+ // Normal case: finalize the file
+ file.finalize();
}
return true;
--- branches/work/kde4_kconfig/kdebug.cpp #606041:606042
@@ -205,7 +205,7 @@
if (!kDebug_data->config && KGlobal::_instance )
{
kDebug_data->config = new KConfig(QLatin1String("kdebugrc"),
- KConfig::ReadWrite, KConfig::NoConfigFlags);
+ KConfig::ReadWrite);
kDebug_data->config->setGroup( QLatin1String("0") );
//AB: this is necessary here, otherwise all output with area 0 won't be
--- branches/work/kde4_kconfig/kglobalsettings.cpp #606041:606042
@@ -43,6 +43,7 @@
#include "kclipboard.h"
//#include "../kdeui/util/kglobalaccel.h"
#include "kstaticdeleter.h"
+#include "kconfig.h"
#include <qcolor.h>
#include <qcursor.h>
@@ -865,7 +866,7 @@
return createApplicationPalette( &cg, KGlobalSettings::contrast() );
}
-QPalette KGlobalSettings::createApplicationPalette( KConfigBase *config, int \
contrast_ ) +QPalette KGlobalSettings::createApplicationPalette( KConfig *config, int \
contrast_ ) {
QColor kde34Background( 239, 239, 239 );
QColor kde34Blue( 103,141,178 );
--- branches/work/kde4_kconfig/kglobalsettings.h #606041:606042
@@ -44,6 +44,7 @@
class QPoint;
class QRect;
class QWidget;
+class KConfig;
/**
* Access the KDE global configuration.
@@ -512,7 +513,7 @@
* Raw access for use by KDM.
* note: expects config to be in the correct group already.
*/
- static QPalette createApplicationPalette( KConfigBase *config, int contrast );
+ static QPalette createApplicationPalette( KConfig *config, int contrast );
/**
* An identifier for change signals.
--- branches/work/kde4_kconfig/kicontheme.cpp #606041:606042
@@ -135,7 +135,7 @@
}
// Use KSharedConfig to avoid parsing the file many times, from each kinstance.
// Need to keep a ref to it to make this useful
- d->sharedConfig = KSharedConfig::openConfig( fileName, KConfig::ReadOnly, \
KConfig::NoConfigFlags ); + d->sharedConfig = KSharedConfig::openConfig( fileName, \
KConfig::ReadOnly ); KConfig& cfg = *d->sharedConfig;
//was: KSimpleConfig cfg(fileName);
--- branches/work/kde4_kconfig/klocale.cpp #606041:606042
@@ -2071,7 +2071,7 @@
QStringList result;
- KConfig config(QString::fromLatin1("language.codes"), KConfig::ReadOnly, \
KConfig::NoConfigFlags); + KConfig config(QString::fromLatin1("language.codes"), \
KConfig::ReadOnly); config.setGroup("TwoLetterCodes");
for ( QStringList::ConstIterator it = origList.begin();
@@ -2105,7 +2105,7 @@
QStringList KLocale::allLanguagesTwoAlpha() const
{
if (!d->languages)
- d->languages = new KConfig("all_languages", KConfig::ReadOnly, \
KConfig::NoConfigFlags, "locale"); + d->languages = new KConfig("all_languages", \
KConfig::ReadOnly, "locale");
return d->languages->groupList();
}
@@ -2113,7 +2113,7 @@
QString KLocale::twoAlphaToLanguageName(const QString &code) const
{
if (!d->languages)
- d->languages = new KConfig("all_languages", KConfig::ReadOnly, \
KConfig::NoConfigFlags, "locale"); + d->languages = new KConfig("all_languages", \
KConfig::ReadOnly, "locale");
QString groupName = code;
int i = groupName.indexOf('_');
@@ -2140,7 +2140,8 @@
QString KLocale::twoAlphaToCountryName(const QString &code) const
{
- KConfig cfg("l10n/"+code.toLower()+"/entry.desktop", KConfig::ReadOnly, \
KConfig::NoConfigFlags, "locale"); + KConfig \
cfg("l10n/"+code.toLower()+"/entry.desktop", + KConfig::ReadOnly, \
"locale"); cfg.setGroup("KCM Locale");
return cfg.readEntry("Name");
}
--- branches/work/kde4_kconfig/knotifyclient.cpp #606041:606042
@@ -46,11 +46,11 @@
}
// startkde event is in global events file
static KConfig* configfile = appname != "ksmserver"
- ? new KConfig( appname + ".eventsrc", KConfig::ReadOnly, \
KConfig::NoConfigFlags )
- : new KConfig( "knotify.eventsrc", KConfig::ReadOnly, KConfig::NoConfigFlags \
); + ? new KConfig( appname + ".eventsrc", KConfig::ReadOnly )
+ : new KConfig( "knotify.eventsrc", KConfig::ReadOnly );
static KConfig* eventsfile = appname != "ksmserver"
- ? new KConfig( appname + "/eventsrc", KConfig::ReadOnly, \
KConfig::NoConfigFlags, "data" )
- : new KConfig( "knotify/eventsrc", KConfig::ReadOnly, \
KConfig::NoConfigFlags, "data" ); + ? new KConfig( appname + "/eventsrc", \
KConfig::ReadOnly, "data" ) + : new KConfig( "knotify/eventsrc", \
KConfig::ReadOnly, "data" ); configfile->setGroup( event );
eventsfile->setGroup( event );
int ev1 = configfile->readEntry( "presentation", -2 );
@@ -150,7 +150,7 @@
int present;
if (eventname.isEmpty()) return Default;
- KConfig eventsfile( KNotifyClient::Instance::current()->instanceName()+".eventsrc", \
KConfig::ReadOnly, KConfig::NoConfigFlags); + KConfig eventsfile( \
KNotifyClient::Instance::current()->instanceName()+".eventsrc", KConfig::ReadOnly); \
eventsfile.setGroup(eventname);
present=eventsfile.readEntry("presentation", -1);
@@ -162,7 +162,7 @@
{
if (eventname.isEmpty()) return QString();
- KConfig eventsfile( KNotifyClient::Instance::current()->instanceName()+".eventsrc", \
KConfig::ReadOnly, KConfig::NoConfigFlags); + KConfig eventsfile( \
KNotifyClient::Instance::current()->instanceName()+".eventsrc", KConfig::ReadOnly); \
eventsfile.setGroup(eventname);
switch (present)
@@ -181,7 +181,7 @@
int present;
if (eventname.isEmpty()) return Default;
- KConfig eventsfile( KNotifyClient::Instance::current()->instanceName()+"/eventsrc", \
KConfig::ReadOnly, KConfig::NoConfigFlags, "data"); + KConfig eventsfile( \
KNotifyClient::Instance::current()->instanceName()+"/eventsrc", KConfig::ReadOnly, \
"data"); eventsfile.setGroup(eventname);
present=eventsfile.readEntry("default_presentation", -1);
@@ -193,7 +193,7 @@
{
if (eventname.isEmpty()) return QString();
- KConfig eventsfile( KNotifyClient::Instance::current()->instanceName()+"/eventsrc", \
KConfig::ReadOnly, KConfig::NoConfigFlags, "data"); + KConfig eventsfile( \
KNotifyClient::Instance::current()->instanceName()+"/eventsrc", KConfig::ReadOnly, \
"data"); eventsfile.setGroup(eventname);
switch (present)
--- branches/work/kde4_kconfig/kservice/kplugininfo.cpp #606041:606042
@@ -70,7 +70,7 @@
KPluginInfo::KPluginInfo( const QString & filename, const char* resource )
: d( new KPluginInfoPrivate )
{
- KDesktopFile file( filename, true, resource );
+ KDesktopFile file( filename, KConfig::ReadOnly, resource );
d->specfile = filename;
--- branches/work/kde4_kconfig/kservice/kservice.cpp #606041:606042
@@ -87,7 +87,7 @@
bool absPath = !QDir::isRelativePath(entryPath());
- QMap<QString, QString> entryMap = config->groupMap(config->group());
+ QMap<QString, QString> entryMap = config->entryMap(config->group());
entryMap.remove("Encoding"); // reserved as part of Desktop Entry Standard
entryMap.remove("Version"); // reserved as part of Desktop Entry Standard
--- branches/work/kde4_kconfig/kstandarddirs.cpp #606041:606042
@@ -49,7 +49,6 @@
#include <qstringlist.h>
#include "kstandarddirs.h"
-#include "kconfig.h"
#include "kdebug.h"
#include "kinstance.h"
#include "kshell.h"
@@ -1544,7 +1543,7 @@
gid_t sup_gids[512];
int sup_gids_nr = getgroups(512, sup_gids);
- KSimpleConfig mapCfg(mapFile, true);
+ KSimpleConfig mapCfg(mapFile, KConfig::ReadOnly);
mapCfg.setGroup("Users");
if (mapCfg.hasKey(user.data()))
{
@@ -1560,7 +1559,7 @@
for( QStringList::ConstIterator it = groups.begin();
it != groups.end(); ++it )
{
- QByteArray grp = (*it).toUtf8();
+ QByteArray grp = it->toUtf8();
// Check if user is in this group
struct group *grp_ent = getgrnam(grp);
if (!grp_ent) continue;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic