diff options
author | Fritz Elfert <felfert@to.com> | 2001-05-21 21:46:35 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2001-05-21 21:46:35 +0000 |
commit | 7b149d56ddc91e1c1c342c894de272cc302b88fb (patch) | |
tree | 70188a5ef857824ef19607222353fb7efd02e462 /kde2 | |
parent | 54c8cf6f971719937edbd38c4e78c57c69894a30 (diff) | |
download | plptools-7b149d56ddc91e1c1c342c894de272cc302b88fb.tar.gz plptools-7b149d56ddc91e1c1c342c894de272cc302b88fb.tar.bz2 plptools-7b149d56ddc91e1c1c342c894de272cc302b88fb.zip |
- Moved include/intl.h to lib/plpintl.h to fix compile of foreign progs.
- KPsion now deletes a machine really if delete is clicked in setup dialog.
- Some NLS-Related fixes
Diffstat (limited to 'kde2')
-rw-r--r-- | kde2/kioslave/Makefile.am | 2 | ||||
-rw-r--r-- | kde2/kpsion/Makefile.am | 4 | ||||
-rw-r--r-- | kde2/kpsion/kpsion.cpp | 9 | ||||
-rw-r--r-- | kde2/kpsion/kpsion.h | 1 | ||||
-rw-r--r-- | kde2/kpsion/kpsionconfig.cpp | 10 | ||||
-rw-r--r-- | kde2/kpsion/kpsionconfig.h | 7 | ||||
-rw-r--r-- | kde2/kpsion/main.cpp | 12 | ||||
-rw-r--r-- | kde2/kpsion/setupdialog.cpp | 63 | ||||
-rw-r--r-- | kde2/plugins/Makefile.am | 2 | ||||
-rw-r--r-- | kde2/plugins/plppropsFactory.cc | 12 |
10 files changed, 94 insertions, 28 deletions
diff --git a/kde2/kioslave/Makefile.am b/kde2/kioslave/Makefile.am index 2614751..d60cde2 100644 --- a/kde2/kioslave/Makefile.am +++ b/kde2/kioslave/Makefile.am @@ -1,5 +1,7 @@ # $Id$ +libdir=$(kde_libraries) + maintainer-clean-local: rm -f Makefile.in diff --git a/kde2/kpsion/Makefile.am b/kde2/kpsion/Makefile.am index 1bb7103..6f401da 100644 --- a/kde2/kpsion/Makefile.am +++ b/kde2/kpsion/Makefile.am @@ -1,5 +1,9 @@ # $Id$ +libdir=$(kde_libraries) + +bindir=$(kde_bindir) + maintainer-clean-local: rm -f Makefile.in diff --git a/kde2/kpsion/kpsion.cpp b/kde2/kpsion/kpsion.cpp index d923ca9..5366270 100644 --- a/kde2/kpsion/kpsion.cpp +++ b/kde2/kpsion/kpsion.cpp @@ -282,6 +282,10 @@ shouldQuit() { } void KPsionMainWindow:: +syncTime(QString uid) { +} + +void KPsionMainWindow:: queryPsion() { u_int32_t devbits; Enum <rfsv::errs> res; @@ -353,6 +357,8 @@ queryPsion() { statusBar()->changeItem(i18n("Connected to %1").arg(machineName), STID_CONNECTION); + syncTime(uid); + if (args->isSet("autobackup")) { // Check, if scheduled backups to perform @@ -958,6 +964,9 @@ typedef QValueList<Barchive>ArchList; void KPsionMainWindow:: removeOldBackups(QStringList &drives) { + if (!fullBackup) + return; + KConfig *config = kapp->config(); KPsionConfig pcfg; diff --git a/kde2/kpsion/kpsion.h b/kde2/kpsion/kpsion.h index c7832b8..a3d5f71 100644 --- a/kde2/kpsion/kpsion.h +++ b/kde2/kpsion/kpsion.h @@ -103,6 +103,7 @@ private: void updateBackupStamps(); void startupNcpd(); void removeOldBackups(QStringList &drives); + void syncTime(QString uid); rfsv *plpRfsv; rpcs *plpRpcs; diff --git a/kde2/kpsion/kpsionconfig.cpp b/kde2/kpsion/kpsionconfig.cpp index d6119a0..3896a80 100644 --- a/kde2/kpsion/kpsionconfig.cpp +++ b/kde2/kpsion/kpsionconfig.cpp @@ -43,6 +43,7 @@ KPsionConfig::KPsionConfig() { optionNames.insert(OPT_DRIVES, QString("Psion/Drives_%1")); optionNames.insert(OPT_LASTFULL, QString("Psion/LastFull_%1_%1")); optionNames.insert(OPT_LASTINC, QString("Psion/LastInc_%1_%1")); + optionNames.insert(OPT_SYNCTIME, QString("Psion/SyncTime_%1")); defaults.insert(DEF_INCINTERVAL, QString("1")); defaults.insert(DEF_FULLINTERVAL, QString("7")); @@ -51,6 +52,7 @@ KPsionConfig::KPsionConfig() { defaults.insert(DEF_SERIALSPEED, QString("4")); defaults.insert(DEF_BACKUPGEN, QString("3")); defaults.insert(DEF_NCPDPATH, QString("ncpd")); + defaults.insert(DEF_SYNCTIME, QString("false")); } const QString KPsionConfig:: @@ -68,6 +70,14 @@ getIntDefault(int optIdx) { return (*it).toInt(); } +bool KPsionConfig:: +getBoolDefault(int optIdx) { + cfgMap::Iterator it = defaults.find(optIdx); + if (it == defaults.end()) + return false; + return ((*it).compare("true") == 0); +} + const QString KPsionConfig:: getOptionName(int optIdx) { cfgMap::Iterator it = optionNames.find(optIdx); diff --git a/kde2/kpsion/kpsionconfig.h b/kde2/kpsion/kpsionconfig.h index 2fddf5e..f2906a0 100644 --- a/kde2/kpsion/kpsionconfig.h +++ b/kde2/kpsion/kpsionconfig.h @@ -48,6 +48,7 @@ public: OPT_LASTFULL = 11, OPT_LASTINC = 12, OPT_NCPDPATH = 13, + OPT_SYNCTIME = 14, }; enum cfgDefaults { @@ -58,7 +59,8 @@ public: DEF_SERIALDEV = 4, DEF_SERIALSPEED = 5, DEF_BACKUPGEN = 6, - DEF_NCPDPATH = 13, + DEF_NCPDPATH = 7, + DEF_SYNCTIME = 8, }; KPsionConfig(); @@ -70,7 +72,8 @@ public: const QString getSectionName(int); const QString getStrDefault(int); int getIntDefault(int); - int getIntervalDays(KConfig *config, int optIdx); + int getIntervalDays(KConfig *, int); + bool getBoolDefault(int); private: cfgMap optionNames; diff --git a/kde2/kpsion/main.cpp b/kde2/kpsion/main.cpp index 6c2aaf9..5a7ac20 100644 --- a/kde2/kpsion/main.cpp +++ b/kde2/kpsion/main.cpp @@ -35,13 +35,11 @@ namespace LIBPLP { extern "C" { -#include <intl.h> - void init_libplp_i18n() { -#ifdef HAVE_BINDTEXTDOMAIN_CODESET - bind_textdomain_codeset(PACKAGE, "latin1"); -#endif - textdomain(PACKAGE); - } +#include <plpintl.h> + void init_libplp_i18n() { + setlocale(LC_ALL, ""); + textdomain(PACKAGE); + } }; }; diff --git a/kde2/kpsion/setupdialog.cpp b/kde2/kpsion/setupdialog.cpp index 73ac65f..66796b1 100644 --- a/kde2/kpsion/setupdialog.cpp +++ b/kde2/kpsion/setupdialog.cpp @@ -34,6 +34,7 @@ #include <klocale.h> #include <kfiledialog.h> #include <kmessagebox.h> +#include <kstddirs.h> #include <qlayout.h> #include <qgroupbox.h> @@ -360,20 +361,58 @@ slotDeleteMachine() { ).arg(mach).arg(nameEdit->text())); if (res != KMessageBox::Yes) return; + + QString bdir = bdirLabel->text() + "/" + mach; + QDir d(bdir); + if (d.exists()) { + d.setFilter(QDir::Files); + QStringList entries = d.entryList(); + QStringList::Iterator ei; + for (ei = entries.begin(); ei != entries.end(); ++ei) { + if (!d.remove(*ei)) { + KMessageBox::error(this, + i18n("Could not remove backup file %1.").arg(*ei)); + return; + } + } + d.rmdir(bdir); + } + machCombo->removeItem(machCombo->currentItem()); - config->setGroup(pcfg.getSectionName(KPsionConfig::OPT_MACHNAME)); - config->writeEntry( - pcfg.getOptionName(KPsionConfig::OPT_MACHNAME).arg(mach), - QString::null); - config->setGroup(pcfg.getSectionName(KPsionConfig::OPT_DRIVES)); - config->writeEntry( - pcfg.getOptionName(KPsionConfig::OPT_DRIVES).arg(mach), - QString::null); - config->setGroup(pcfg.getSectionName(KPsionConfig::OPT_BACKUPDRIVES)); - config->writeEntry( - pcfg.getOptionName(KPsionConfig::OPT_BACKUPDRIVES).arg(mach), - QString::null); + QStringList sl = config->readListEntry( + pcfg.getOptionName(KPsionConfig::OPT_DRIVES).arg(mach)); + config->sync(); + + QString dcfgName = + KGlobal::dirs()->saveLocation("config", QString::null, false); + dcfgName += "kpsionrc"; + KSimpleConfig dcfg(dcfgName); + dcfg.setGroup(pcfg.getSectionName(KPsionConfig::OPT_MACHNAME)); + dcfg.deleteEntry(pcfg.getOptionName( + KPsionConfig::OPT_MACHNAME).arg(mach), false); + dcfg.setGroup(pcfg.getSectionName(KPsionConfig::OPT_DRIVES)); + dcfg.deleteEntry(pcfg.getOptionName( + KPsionConfig::OPT_DRIVES).arg(mach), false); + dcfg.setGroup(pcfg.getSectionName(KPsionConfig::OPT_BACKUPDRIVES)); + dcfg.deleteEntry(pcfg.getOptionName( + KPsionConfig::OPT_BACKUPDRIVES).arg(mach), false); + QStringList::Iterator it; + for (it = sl.begin(); it != sl.end(); it++) { + dcfg.setGroup(pcfg.getSectionName(KPsionConfig::OPT_LASTFULL)); + dcfg.deleteEntry(pcfg.getOptionName( + KPsionConfig::OPT_LASTFULL).arg(mach).arg(*it), false); + dcfg.setGroup(pcfg.getSectionName(KPsionConfig::OPT_LASTINC)); + dcfg.deleteEntry(pcfg.getOptionName( + KPsionConfig::OPT_LASTINC).arg(mach).arg(*it), false); + } + dcfg.sync(); + config->reparseConfiguration(); + config->setGroup(pcfg.getSectionName(KPsionConfig::OPT_UIDS)); + sl = config->readListEntry(pcfg.getOptionName(KPsionConfig::OPT_UIDS)); + sl.remove(mach); + config->writeEntry(pcfg.getOptionName(KPsionConfig::OPT_UIDS), sl); + slotMachineChanged(-1); } diff --git a/kde2/plugins/Makefile.am b/kde2/plugins/Makefile.am index 96e0da1..c072832 100644 --- a/kde2/plugins/Makefile.am +++ b/kde2/plugins/Makefile.am @@ -1,4 +1,6 @@ +libdir=$(kde_libraries) + INCLUDES = $(all_includes) -I$(top_srcdir)/lib LDFLAGS = $(all_libraries) diff --git a/kde2/plugins/plppropsFactory.cc b/kde2/plugins/plppropsFactory.cc index 45b47b1..f483ef9 100644 --- a/kde2/plugins/plppropsFactory.cc +++ b/kde2/plugins/plppropsFactory.cc @@ -5,13 +5,11 @@ #ifdef ENABLE_NLS namespace LIBPLP { extern "C" { -#include <intl.h> - void init_libplp_i18n() { -#ifdef HAVE_BINDTEXTDOMAIN_CODESET - bind_textdomain_codeset(PACKAGE, "latin1"); -#endif - textdomain(PACKAGE); - } +#include <plpintl.h> + void init_libplp_i18n() { + setlocale(LC_ALL, ""); + textdomain(PACKAGE); + } }; }; #endif |