Diffstat (limited to 'kabc/plugins/opie/resourceopieconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/opie/resourceopieconfig.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kabc/plugins/opie/resourceopieconfig.cpp b/kabc/plugins/opie/resourceopieconfig.cpp index b92cfa1..f4cc4f9 100644 --- a/kabc/plugins/opie/resourceopieconfig.cpp +++ b/kabc/plugins/opie/resourceopieconfig.cpp | |||
@@ -26,27 +26,30 @@ $Id$ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | 30 | ||
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <klocale.h> | 32 | #include <klocale.h> |
33 | #include <kstandarddirs.h> | 33 | #include <kstandarddirs.h> |
34 | #include <kdialog.h> | 34 | #include <kdialog.h> |
35 | 35 | ||
36 | #include <unistd.h> | 36 | #include <unistd.h> |
37 | 37 | ||
38 | #include <qdir.h> | ||
38 | #include <qfile.h> | 39 | #include <qfile.h> |
39 | #include "resourceopie.h" | 40 | #include "resourceopie.h" |
40 | #include "stdaddressbook.h" | 41 | //US #include <qpe/qpeapplication.h> |
42 | |||
43 | //US #include "stdaddressbook.h" | ||
41 | 44 | ||
42 | #include "resourceopieconfig.h" | 45 | #include "resourceopieconfig.h" |
43 | 46 | ||
44 | using namespace KABC; | 47 | using namespace KABC; |
45 | 48 | ||
46 | ResourceOpieConfig::ResourceOpieConfig( QWidget* parent, const char* name ) | 49 | ResourceOpieConfig::ResourceOpieConfig( QWidget* parent, const char* name ) |
47 | : ConfigWidget( parent, name ) | 50 | : ConfigWidget( parent, name ) |
48 | { | 51 | { |
49 | //qDebug("ResourceFileConfig::ResourceFileConfig"); | 52 | //qDebug("ResourceFileConfig::ResourceFileConfig"); |
50 | 53 | ||
51 | QGridLayout *mainLayout = new QGridLayout( this, 1, 2, 0, | 54 | QGridLayout *mainLayout = new QGridLayout( this, 1, 2, 0, |
52 | KDialog::spacingHint() ); | 55 | KDialog::spacingHint() ); |
@@ -72,36 +75,38 @@ void ResourceOpieConfig::setEditMode( bool value ) | |||
72 | void ResourceOpieConfig::loadSettings( KRES::Resource *res ) | 75 | void ResourceOpieConfig::loadSettings( KRES::Resource *res ) |
73 | { | 76 | { |
74 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); | 77 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); |
75 | ResourceOpie *resource = (ResourceOpie*)( res ); | 78 | ResourceOpie *resource = (ResourceOpie*)( res ); |
76 | 79 | ||
77 | if ( !resource ) { | 80 | if ( !resource ) { |
78 | kdDebug(5700) << "ResourceOpieConfig::loadSettings(): cast failed" << endl; | 81 | kdDebug(5700) << "ResourceOpieConfig::loadSettings(): cast failed" << endl; |
79 | return; | 82 | return; |
80 | } | 83 | } |
81 | 84 | ||
82 | mFileNameEdit->setURL( resource->fileName() ); | 85 | mFileNameEdit->setURL( resource->fileName() ); |
83 | if ( mFileNameEdit->url().isEmpty() ) | 86 | if ( mFileNameEdit->url().isEmpty() ) |
84 | mFileNameEdit->setURL( KABC::StdAddressBook::fileName() ); | 87 | mFileNameEdit->setURL( QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml" ); |
85 | } | 88 | } |
86 | 89 | ||
87 | void ResourceOpieConfig::saveSettings( KRES::Resource *res ) | 90 | void ResourceOpieConfig::saveSettings( KRES::Resource *res ) |
88 | { | 91 | { |
89 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); | 92 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); |
90 | ResourceOpie *resource = (ResourceOpie*)( res ); | 93 | ResourceOpie *resource = (ResourceOpie*)( res ); |
91 | 94 | ||
92 | if ( !resource ) { | 95 | if ( !resource ) { |
93 | kdDebug(5700) << "ResourceOpieConfig::saveSettings(): cast failed" << endl; | 96 | kdDebug(5700) << "ResourceOpieConfig::saveSettings(): cast failed" << endl; |
94 | return; | 97 | return; |
95 | } | 98 | } |
96 | 99 | ||
97 | resource->setFileName( mFileNameEdit->url() ); | 100 | resource->setFileName( mFileNameEdit->url() ); |
98 | } | 101 | } |
99 | 102 | ||
100 | void ResourceOpieConfig::checkFilePermissions( const QString& fileName ) | 103 | void ResourceOpieConfig::checkFilePermissions( const QString& fileName ) |
101 | { | 104 | { |
102 | // If file exist but is not writeable... | 105 | // If file exist but is not writeable... |
106 | /*US | ||
103 | if ( access( QFile::encodeName( fileName ), F_OK ) == 0 ) | 107 | if ( access( QFile::encodeName( fileName ), F_OK ) == 0 ) |
104 | emit setReadOnly( access( QFile::encodeName( fileName ), W_OK ) < 0 ); | 108 | emit setReadOnly( access( QFile::encodeName( fileName ), W_OK ) < 0 ); |
109 | */ | ||
105 | } | 110 | } |
106 | 111 | ||
107 | //US #include "resourceopieconfig.moc" | 112 | //US #include "resourceopieconfig.moc" |