summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp17
-rw-r--r--kabc/plugins/dir/resourcedir.h3
-rw-r--r--kabc/plugins/file/resourcefile.cpp20
-rw-r--r--kabc/plugins/file/resourcefile.h3
-rw-r--r--microkde/kresources/configpage.cpp14
5 files changed, 35 insertions, 22 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index 7d96cb7..e58e4f7 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -57,4 +57,5 @@ $Id$
#include <qdir.h>
+#define NO_DIRWATCH
#include "resourcedir.h"
#include "syncprefwidget.h"
@@ -114,9 +115,9 @@ ResourceDir::ResourceDir( const KConfig *config, bool syncable )
qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1());
*/
-
+#ifndef NO_DIRWATCH
connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) );
connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) );
connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) );
-
+#endif
setPath( path );
}
@@ -209,7 +210,7 @@ bool ResourceDir::save( Ticket *ticket )
AddressBook::Iterator it;
bool ok = true;
-
+#ifndef NO_DIRWATCH
mDirWatch.stopScan();
-
+#endif
for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
if ( (*it).resource() != this || !(*it).changed() )
@@ -229,6 +230,7 @@ bool ResourceDir::save( Ticket *ticket )
file.close();
}
+#ifndef NO_DIRWATCH
mDirWatch.startScan();
-
+#endif
delete ticket;
#ifdef ALLOW_LOCKING
@@ -302,4 +304,5 @@ void ResourceDir::unlock( const QString &path )
void ResourceDir::setPath( const QString &path )
{
+#ifndef NO_DIRWATCH
mDirWatch.stopScan();
mDirWatch.removeDir( mPath );
@@ -309,5 +312,7 @@ void ResourceDir::setPath( const QString &path )
mDirWatch.addDir( mPath, true );
mDirWatch.startScan();
-
+#else
+ mPath = path;
+#endif
//US simulate KDirWatch event
//US pathChanged();
diff --git a/kabc/plugins/dir/resourcedir.h b/kabc/plugins/dir/resourcedir.h
index c2aedad..77cd18c 100644
--- a/kabc/plugins/dir/resourcedir.h
+++ b/kabc/plugins/dir/resourcedir.h
@@ -105,6 +105,7 @@ private:
FormatPlugin *mFormat;
+#ifndef NO_DIRWATCH
KDirWatch mDirWatch;
-
+#endif
QString mPath;
QString mFormatName;
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp
index 17263ae..b8c32d5 100644
--- a/kabc/plugins/file/resourcefile.cpp
+++ b/kabc/plugins/file/resourcefile.cpp
@@ -50,5 +50,5 @@ $Id$
#include "resourcefileconfig.h"
#include "stdaddressbook.h"
-
+#define NO_DIRWATCH
#include "resourcefile.h"
#include "syncprefwidget.h"
@@ -56,4 +56,6 @@ $Id$
//#define ALLOW_LOCKING
+
+
using namespace KABC;
@@ -116,9 +118,9 @@ void ResourceFile::init( const QString &fileName, const QString &formatName )
}
-
+#ifndef NO_DIRWATCH
connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
-
+#endif
setFileName( fileName );
}
@@ -228,6 +230,7 @@ bool ResourceFile::save( Ticket *ticket )
//US ToDo: write backupfile
+#ifndef NO_DIRWATCH
mDirWatch.stopScan();
-
+#endif
QFile info;
info.setName( mFileName );
@@ -245,7 +248,7 @@ bool ResourceFile::save( Ticket *ticket )
if ( !ok )
addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) );
-
+#ifndef NO_DIRWATCH
mDirWatch.startScan();
-
+#endif
delete ticket;
#ifdef ALLOW_LOCKING
@@ -327,7 +330,7 @@ void ResourceFile::unlock( const QString &fileName )
void ResourceFile::setFileName( const QString &fileName )
{
+#ifndef NO_DIRWATCH
mDirWatch.stopScan();
mDirWatch.removeFile( mFileName );
-
mFileName = fileName;
@@ -335,4 +338,7 @@ void ResourceFile::setFileName( const QString &fileName )
mDirWatch.addFile( mFileName );
mDirWatch.startScan();
+#else
+ mFileName = fileName;
+#endif
//US simulate KDirWatch event
diff --git a/kabc/plugins/file/resourcefile.h b/kabc/plugins/file/resourcefile.h
index 0a3027c..8339340 100644
--- a/kabc/plugins/file/resourcefile.h
+++ b/kabc/plugins/file/resourcefile.h
@@ -154,6 +154,7 @@ private:
QString mLockUniqueName;
-
+#ifndef NO_DIRWATCH
KDirWatch mDirWatch;
+#endif
};
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp
index 1a3a22c..02c5fb1 100644
--- a/microkde/kresources/configpage.cpp
+++ b/microkde/kresources/configpage.cpp
@@ -101,6 +101,6 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this );
groupBox->setColumnLayout(0, Qt::Vertical );
- groupBox->layout()->setSpacing( 6 );
- groupBox->layout()->setMargin( 11 );
+ groupBox->layout()->setSpacing( 3 );
+ groupBox->layout()->setMargin( 5 );
QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 );
@@ -113,5 +113,5 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
mListView->addColumn( i18n( "Name" ) );
mListView->addColumn( i18n( "Type" ) );
- mListView->addColumn( i18n( "Standard" ) );
+ mListView->addColumn( i18n( "Standard" ) );
//US groupBoxLayout->addWidget( mListView, 1, 0 );
@@ -119,11 +119,11 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
- mAddButton = new QPushButton( i18n( "&Add..." ), this );
+ mAddButton = new QPushButton( i18n( "&Add..." ), groupBox );
groupBoxLayout->addWidget( mAddButton, 2, 0 );
- mRemoveButton = new QPushButton( i18n( "&Remove" ), this );
+ mRemoveButton = new QPushButton( i18n( "&Remove" ), groupBox );
groupBoxLayout->addWidget( mRemoveButton, 2, 1 );
- mEditButton = new QPushButton( i18n( "&Edit..." ), this );
+ mEditButton = new QPushButton( i18n( "&Edit..." ), groupBox );
groupBoxLayout->addWidget( mEditButton, 3, 0 );
- mStandardButton = new QPushButton( i18n( "&Use as Standard" ), this );
+ mStandardButton = new QPushButton( i18n( "&Use as Standard" ), groupBox );
groupBoxLayout->addWidget( mStandardButton, 3, 1 );