author | ulf69 <ulf69> | 2004-10-20 18:38:39 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-20 18:38:39 (UTC) |
commit | 8e00329a4a5f0b66d26d20f067ab6aefca17f17a (patch) (unidiff) | |
tree | 9fa40d29baece91dc854b7e124c3bbc2962a0729 | |
parent | 13243e1fb1855d306d45a84365f55e20efeff69d (diff) | |
download | kdepimpi-8e00329a4a5f0b66d26d20f067ab6aefca17f17a.zip kdepimpi-8e00329a4a5f0b66d26d20f067ab6aefca17f17a.tar.gz kdepimpi-8e00329a4a5f0b66d26d20f067ab6aefca17f17a.tar.bz2 |
removed dead code
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 30 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.cpp | 25 |
2 files changed, 27 insertions, 28 deletions
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index c511661..66d26d6 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp | |||
@@ -721,18 +721,18 @@ void PwM::editPwd_slot3(const QString *category, const int *index, | |||
721 | currItem.pw = w.getPassword().latin1(); | 721 | currItem.pw = w.getPassword().latin1(); |
722 | currItem.comment = w.getComment().latin1(); | 722 | currItem.comment = w.getComment().latin1(); |
723 | currItem.url = w.getUrl().latin1(); | 723 | currItem.url = w.getUrl().latin1(); |
724 | currItem.launcher = w.getLauncher().latin1(); | 724 | currItem.launcher = w.getLauncher().latin1(); |
725 | if (!doc->editEntry(curCategory, w.getCategory(), | 725 | if (!doc->editEntry(curCategory, w.getCategory(), |
726 | curEntryIndex, &currItem)) { | 726 | curEntryIndex, &currItem)) { |
727 | KMessageBox::error(this, | 727 | KMessageBox::error(this, |
728 | i18n("Couldn't edit the entry.\n" | 728 | i18n("Couldn't edit the entry.\n" |
729 | "Maybe you changed the category and " | 729 | "Maybe you changed the category and\n" |
730 | "this entry is already present in the new " | 730 | "this entry is already present\nin the new " |
731 | "category?"), | 731 | "category?"), |
732 | i18n("couldn't edit entry.")); | 732 | i18n("couldn't edit entry.")); |
733 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 733 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
734 | return; | 734 | return; |
735 | } | 735 | } |
736 | } | 736 | } |
737 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 737 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
738 | } | 738 | } |
@@ -910,31 +910,31 @@ void PwM::exportToText() | |||
910 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 910 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
911 | return; | 911 | return; |
912 | } | 912 | } |
913 | 913 | ||
914 | PwMerror ret = curDoc()->exportToText(&fn); | 914 | PwMerror ret = curDoc()->exportToText(&fn); |
915 | if (ret != e_success) { | 915 | if (ret != e_success) { |
916 | KMessageBox::error(this, | 916 | KMessageBox::error(this, |
917 | i18n("Error: Couldn't write to file.\n" | 917 | i18n("Error: Couldn't write to file.\n" |
918 | "Please check if you have permission to write " | 918 | "Please check if you have permission to write\n" |
919 | "to the file in that directory."), | 919 | "to the file in that directory."), |
920 | i18n("error while writing")); | 920 | i18n("error while writing")); |
921 | } else | 921 | } else |
922 | showStatMsg(i18n("Successfully exported data.")); | 922 | showStatMsg(i18n("Successfully exported data.")); |
923 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 923 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
924 | } | 924 | } |
925 | 925 | ||
926 | bool PwM::importFromText() | 926 | bool PwM::importFromText() |
927 | { | 927 | { |
928 | if (!isVirgin()) { | 928 | if (!isVirgin()) { |
929 | if (KMessageBox::questionYesNo(this, | 929 | if (KMessageBox::questionYesNo(this, |
930 | i18n("Do you want to import the data " | 930 | i18n("Do you want to import the data\n" |
931 | "into the current document? (If you " | 931 | "into the current document? (If you\n" |
932 | "select \"no\", a new document will be " | 932 | "select \"no\", a new document will be\n" |
933 | "opened.)"), | 933 | "opened.)"), |
934 | i18n("import into this document?")) | 934 | i18n("import into this document?")) |
935 | == KMessageBox::No) { | 935 | == KMessageBox::No) { |
936 | // import the data to a new window. | 936 | // import the data to a new window. |
937 | PwM *newInstance = init->createMainWnd(); | 937 | PwM *newInstance = init->createMainWnd(); |
938 | bool ok = newInstance->importFromText(); | 938 | bool ok = newInstance->importFromText(); |
939 | if (!ok) { | 939 | if (!ok) { |
940 | newInstance->setForceQuit(true); | 940 | newInstance->setForceQuit(true); |
@@ -951,27 +951,27 @@ bool PwM::importFromText() | |||
951 | this)); | 951 | this)); |
952 | if (path == "") | 952 | if (path == "") |
953 | goto cancelImport; | 953 | goto cancelImport; |
954 | 954 | ||
955 | ret = curDoc()->importFromText(&path, 0); | 955 | ret = curDoc()->importFromText(&path, 0); |
956 | if (ret == e_fileFormat) { | 956 | if (ret == e_fileFormat) { |
957 | KMessageBox::error(this, | 957 | KMessageBox::error(this, |
958 | i18n("Could not read file-format.\n" | 958 | i18n("Could not read file-format.\n" |
959 | "This seems to be _not_ a valid file " | 959 | "This seems to be _not_ a valid file\n" |
960 | "exported by PwM."), | 960 | "exported by PwM."), |
961 | i18n("invalid file-format")); | 961 | i18n("invalid file-format")); |
962 | goto cancelImport; | 962 | goto cancelImport; |
963 | } else if (ret == e_invalidArg) { | 963 | } else if (ret == e_invalidArg) { |
964 | BUG(); | 964 | BUG(); |
965 | goto cancelImport; | 965 | goto cancelImport; |
966 | } else if (ret != e_success) { | 966 | } else if (ret != e_success) { |
967 | KMessageBox::error(this, | 967 | KMessageBox::error(this, |
968 | i18n("Could not import file!\n" | 968 | i18n("Could not import file!\n" |
969 | "Do you have permission to read this file? " | 969 | "Do you have permission to read this file?\n" |
970 | "Do you have enough free memory?"), | 970 | "Do you have enough free memory?"), |
971 | i18n("import failed")); | 971 | i18n("import failed")); |
972 | goto cancelImport; | 972 | goto cancelImport; |
973 | } | 973 | } |
974 | setVirgin(false); | 974 | setVirgin(false); |
975 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 975 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
976 | return true; | 976 | return true; |
977 | 977 | ||
@@ -1044,19 +1044,19 @@ void PwM::exportToKWallet() | |||
1044 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1044 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1045 | #endif // CONFIG_KWALLETIF | 1045 | #endif // CONFIG_KWALLETIF |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | bool PwM::importFromGpasman() | 1048 | bool PwM::importFromGpasman() |
1049 | { | 1049 | { |
1050 | if (!isVirgin()) { | 1050 | if (!isVirgin()) { |
1051 | if (KMessageBox::questionYesNo(this, | 1051 | if (KMessageBox::questionYesNo(this, |
1052 | i18n("Do you want to import the data " | 1052 | i18n("Do you want to import the data\n" |
1053 | "into the current document? (If you " | 1053 | "into the current document? (If you\n" |
1054 | "select \"no\", a new document will be " | 1054 | "select \"no\", a new document will be\n" |
1055 | "opened.)"), | 1055 | "opened.)"), |
1056 | i18n("import into this document?")) | 1056 | i18n("import into this document?")) |
1057 | == KMessageBox::No) { | 1057 | == KMessageBox::No) { |
1058 | // import the data to a new window. | 1058 | // import the data to a new window. |
1059 | PwM *newInstance = init->createMainWnd(); | 1059 | PwM *newInstance = init->createMainWnd(); |
1060 | bool ok = newInstance->importFromGpasman(); | 1060 | bool ok = newInstance->importFromGpasman(); |
1061 | if (!ok) { | 1061 | if (!ok) { |
1062 | newInstance->setForceQuit(true); | 1062 | newInstance->setForceQuit(true); |
@@ -1071,21 +1071,21 @@ bool PwM::importFromGpasman() | |||
1071 | QString path(KFileDialog::getOpenFileName(QString::null, | 1071 | QString path(KFileDialog::getOpenFileName(QString::null, |
1072 | i18n("*|Gpasman or Kpasman file"), this)); | 1072 | i18n("*|Gpasman or Kpasman file"), this)); |
1073 | if (path == "") | 1073 | if (path == "") |
1074 | goto cancelImport; | 1074 | goto cancelImport; |
1075 | ret = curDoc()->importFromGpasman(&path); | 1075 | ret = curDoc()->importFromGpasman(&path); |
1076 | if (ret == e_wrongPw) { | 1076 | if (ret == e_wrongPw) { |
1077 | if (KMessageBox::questionYesNo(this, | 1077 | if (KMessageBox::questionYesNo(this, |
1078 | i18n | 1078 | i18n |
1079 | ("This is probably the wrong master-password" | 1079 | ("This is probably the wrong master-password\n" |
1080 | "you have typed in.\n" | 1080 | "you have typed in.\n" |
1081 | "There is no real way to determine the " | 1081 | "There is no real way to determine the\n" |
1082 | "correctness of the password in the Gpasman " | 1082 | "correctness of the password in the Gpasman\n" |
1083 | "file-format. But I think this " | 1083 | "file-format. But I think this\n" |
1084 | "password ist wrong.\n" | 1084 | "password ist wrong.\n" |
1085 | "Do you want to continue nevertheless?"), | 1085 | "Do you want to continue nevertheless?"), |
1086 | i18n("password error")) | 1086 | i18n("password error")) |
1087 | == KMessageBox::No) { | 1087 | == KMessageBox::No) { |
1088 | goto cancelImport; | 1088 | goto cancelImport; |
1089 | } | 1089 | } |
1090 | } else if (ret != e_success) { | 1090 | } else if (ret != e_success) { |
1091 | KMessageBox::error(this, | 1091 | KMessageBox::error(this, |
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp index 8869f3a..86b6273 100644 --- a/pwmanager/pwmanager/pwmdoc.cpp +++ b/pwmanager/pwmanager/pwmdoc.cpp | |||
@@ -1259,41 +1259,47 @@ PwMerror PwMDoc::getCommentByLvp(const QString &category, int listViewPos, | |||
1259 | 1259 | ||
1260 | bool PwMDoc::compressDta(string *d, char algo) | 1260 | bool PwMDoc::compressDta(string *d, char algo) |
1261 | { | 1261 | { |
1262 | PWM_ASSERT(d); | 1262 | PWM_ASSERT(d); |
1263 | switch (algo) { | 1263 | switch (algo) { |
1264 | case PWM_COMPRESS_GZIP: { | 1264 | case PWM_COMPRESS_GZIP: { |
1265 | CompressGzip comp; | 1265 | CompressGzip comp; |
1266 | return comp.compress(d); | 1266 | return comp.compress(d); |
1267 | /*US } case PWM_COMPRESS_BZIP2: { | 1267 | } |
1268 | #ifndef PWM_EMBEDDED | ||
1269 | case PWM_COMPRESS_BZIP2: { | ||
1268 | CompressBzip2 comp; | 1270 | CompressBzip2 comp; |
1269 | return comp.compress(d); | 1271 | return comp.compress(d); |
1270 | */ | 1272 | } |
1271 | } case PWM_COMPRESS_NONE: { | 1273 | #endif |
1274 | case PWM_COMPRESS_NONE: { | ||
1272 | return true; | 1275 | return true; |
1273 | } default: { | 1276 | } default: { |
1274 | BUG(); | 1277 | BUG(); |
1275 | } | 1278 | } |
1276 | } | 1279 | } |
1277 | return false; | 1280 | return false; |
1278 | } | 1281 | } |
1279 | 1282 | ||
1280 | bool PwMDoc::decompressDta(string *d, char algo) | 1283 | bool PwMDoc::decompressDta(string *d, char algo) |
1281 | { | 1284 | { |
1282 | PWM_ASSERT(d); | 1285 | PWM_ASSERT(d); |
1283 | switch (algo) { | 1286 | switch (algo) { |
1284 | case PWM_COMPRESS_GZIP: { | 1287 | case PWM_COMPRESS_GZIP: { |
1285 | CompressGzip comp; | 1288 | CompressGzip comp; |
1286 | return comp.decompress(d); | 1289 | return comp.decompress(d); |
1287 | /*US } case PWM_COMPRESS_BZIP2: { | 1290 | } |
1291 | #ifndef PWM_EMBEDDED | ||
1292 | case PWM_COMPRESS_BZIP2: { | ||
1288 | CompressBzip2 comp; | 1293 | CompressBzip2 comp; |
1289 | return comp.decompress(d); | 1294 | return comp.decompress(d); |
1290 | */ | 1295 | } |
1291 | } case PWM_COMPRESS_NONE: { | 1296 | #endif |
1297 | case PWM_COMPRESS_NONE: { | ||
1292 | return true; | 1298 | return true; |
1293 | } | 1299 | } |
1294 | } | 1300 | } |
1295 | return false; | 1301 | return false; |
1296 | } | 1302 | } |
1297 | 1303 | ||
1298 | PwMerror PwMDoc::encrypt(string *d, const QString *pw, QFile *f, char algo) | 1304 | PwMerror PwMDoc::encrypt(string *d, const QString *pw, QFile *f, char algo) |
1299 | { | 1305 | { |
@@ -3118,25 +3124,22 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s | |||
3118 | } | 3124 | } |
3119 | } | 3125 | } |
3120 | } else { // no conflict | 3126 | } else { // no conflict |
3121 | if ( inRemote->meta.update > mLastSync || mode == 5 ) { | 3127 | if ( inRemote->meta.update > mLastSync || mode == 5 ) { |
3122 | inRemote->meta.update = modifiedSync; | 3128 | inRemote->meta.update = modifiedSync; |
3123 | 3129 | ||
3124 | //first check if we have a matching category in the local file | 3130 | //first check if we have a matching category in the local file |
3125 | const string* remotecat = syncRemote->getCategory(catRemote); | 3131 | const string* remotecat = syncRemote->getCategory(catRemote); |
3126 | //US syncRemote->insertAddressee( inRemote, false ); | ||
3127 | //US syncLocal->insertAddressee( inRemote, false ); | ||
3128 | syncLocal->addEntry(remotecat->c_str(), inRemote, true, false); | 3132 | syncLocal->addEntry(remotecat->c_str(), inRemote, true, false); |
3129 | 3133 | ||
3130 | ++addedPasswordsLocal; | 3134 | ++addedPasswordsLocal; |
3131 | } else { | 3135 | } else { |
3132 | // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); | 3136 | // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); |
3133 | syncRemote->delEntry(catRemote, indexRemote, true); | 3137 | syncRemote->delEntry(catRemote, indexRemote, true); |
3134 | //USsyncRemote->removeAddressee( inRemote ); | ||
3135 | ++deletedPasswordsRemote; | 3138 | ++deletedPasswordsRemote; |
3136 | } | 3139 | } |
3137 | } | 3140 | } |
3138 | 3141 | ||
3139 | ++incCounter; | 3142 | ++incCounter; |
3140 | } | 3143 | } |
3141 | 3144 | ||
3142 | 3145 | ||
@@ -3158,27 +3161,25 @@ PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* s | |||
3158 | inLocal = syncLocal->findEntryByID( uid, &catLocal, &indexLocal ); | 3161 | inLocal = syncLocal->findEntryByID( uid, &catLocal, &indexLocal ); |
3159 | inRemote = syncRemote->findEntryByID( uid, &catRemote, &indexRemote ); | 3162 | inRemote = syncRemote->findEntryByID( uid, &catRemote, &indexRemote ); |
3160 | PWM_ASSERT(inLocal); | 3163 | PWM_ASSERT(inLocal); |
3161 | 3164 | ||
3162 | if ( inRemote == 0 ) { | 3165 | if ( inRemote == 0 ) { |
3163 | if ( inLocal->meta.update < mLastSync && mode != 4 ) { | 3166 | if ( inLocal->meta.update < mLastSync && mode != 4 ) { |
3164 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); | 3167 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); |
3165 | syncLocal->delEntry(catLocal, indexLocal, true); | 3168 | syncLocal->delEntry(catLocal, indexLocal, true); |
3166 | //USsyncLocal->removeAddressee( inLocal ); | ||
3167 | ++deletedPasswordsLocal; | 3169 | ++deletedPasswordsLocal; |
3168 | } else { | 3170 | } else { |
3169 | if ( ! manager->mWriteBackExistingOnly ) { | 3171 | if ( ! manager->mWriteBackExistingOnly ) { |
3170 | ++addedPasswordsRemote; | 3172 | ++addedPasswordsRemote; |
3171 | inLocal->meta.update = modifiedSync; | 3173 | inLocal->meta.update = modifiedSync; |
3172 | 3174 | ||
3173 | //first check if we have a matching category in the remote file | 3175 | //first check if we have a matching category in the remote file |
3174 | const string* localcat = syncLocal->getCategory(catLocal); | 3176 | const string* localcat = syncLocal->getCategory(catLocal); |
3175 | 3177 | ||
3176 | //USsyncLocal->insertAddressee( inLocal, false ); | ||
3177 | PwMDataItem newEntry; | 3178 | PwMDataItem newEntry; |
3178 | newEntry = *inLocal; | 3179 | newEntry = *inLocal; |
3179 | inRemote = &newEntry; | 3180 | inRemote = &newEntry; |
3180 | 3181 | ||
3181 | //USsyncRemote->insertAddressee( inRemote, false ); | 3182 | //USsyncRemote->insertAddressee( inRemote, false ); |
3182 | syncRemote->addEntry(localcat->c_str(), inRemote, true, false); | 3183 | syncRemote->addEntry(localcat->c_str(), inRemote, true, false); |
3183 | 3184 | ||
3184 | } | 3185 | } |
@@ -3215,18 +3216,16 @@ int PwMDoc::takePwMDataItem( PwMDataItem* local, PwMDataItem* remote, QDateTime | |||
3215 | { | 3216 | { |
3216 | // 0 equal | 3217 | // 0 equal |
3217 | // 1 take local | 3218 | // 1 take local |
3218 | // 2 take remote | 3219 | // 2 take remote |
3219 | // 3 cancel | 3220 | // 3 cancel |
3220 | QDateTime localMod = local->meta.update; | 3221 | QDateTime localMod = local->meta.update; |
3221 | QDateTime remoteMod = remote->meta.update; | 3222 | QDateTime remoteMod = remote->meta.update; |
3222 | 3223 | ||
3223 | //US QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | ||
3224 | |||
3225 | if ( localMod == remoteMod ) | 3224 | if ( localMod == remoteMod ) |
3226 | return 0; | 3225 | return 0; |
3227 | 3226 | ||
3228 | qDebug(" %d %d conflict on %s %s ", mode, full, local->desc.c_str(), remote->desc.c_str() ); | 3227 | qDebug(" %d %d conflict on %s %s ", mode, full, local->desc.c_str(), remote->desc.c_str() ); |
3229 | 3228 | ||
3230 | //qDebug("%s %d %s %d", local->lastModified().toString().latin1() , localMod, remote->lastModified().toString().latin1(), remoteMod); | 3229 | //qDebug("%s %d %s %d", local->lastModified().toString().latin1() , localMod, remote->lastModified().toString().latin1(), remoteMod); |
3231 | //qDebug("%d %d %d %d ", local->lastModified().time().second(), local->lastModified().time().msec(), remote->lastModified().time().second(), remote->lastModified().time().msec() ); | 3230 | //qDebug("%d %d %d %d ", local->lastModified().time().second(), local->lastModified().time().msec(), remote->lastModified().time().second(), remote->lastModified().time().msec() ); |
3232 | //full = true; //debug only | 3231 | //full = true; //debug only |