Changeset View
Changeset View
Standalone View
Standalone View
part.cpp
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | |||||
63 | #include <KMessageBox> | 63 | #include <KMessageBox> | ||
64 | #include <KPasswordDialog> | 64 | #include <KPasswordDialog> | ||
65 | #include <KPluginFactory> | 65 | #include <KPluginFactory> | ||
66 | #include <KPluginMetaData> | 66 | #include <KPluginMetaData> | ||
67 | #include <KSharedDataCache> | 67 | #include <KSharedDataCache> | ||
68 | #include <KStandardShortcut> | 68 | #include <KStandardShortcut> | ||
69 | #include <KToggleAction> | 69 | #include <KToggleAction> | ||
70 | #include <KToggleFullScreenAction> | 70 | #include <KToggleFullScreenAction> | ||
71 | #include <KWallet> | 71 | // #include <KWallet> | ||
72 | #include <KXMLGUIClient> | 72 | #include <KXMLGUIClient> | ||
73 | #include <KXMLGUIFactory> | 73 | #include <KXMLGUIFactory> | ||
74 | 74 | | |||
75 | 75 | | |||
76 | #if PURPOSE_FOUND | 76 | #if PURPOSE_FOUND | ||
77 | #include <Purpose/AlternativesModel> | 77 | #include <Purpose/AlternativesModel> | ||
78 | #include <PurposeWidgets/Menu> | 78 | #include <PurposeWidgets/Menu> | ||
79 | #endif | 79 | #endif | ||
▲ Show 20 Lines • Show All 1300 Lines • ▼ Show 20 Line(s) | 1378 | { | |||
1380 | isDocumentArchive = true; | 1380 | isDocumentArchive = true; | ||
1381 | } | 1381 | } | ||
1382 | else | 1382 | else | ||
1383 | { | 1383 | { | ||
1384 | openResult = m_document->openDocument( fileNameToOpen, url(), mime ); | 1384 | openResult = m_document->openDocument( fileNameToOpen, url(), mime ); | ||
1385 | } | 1385 | } | ||
1386 | m_documentOpenWithPassword = false; | 1386 | m_documentOpenWithPassword = false; | ||
1387 | 1387 | | |||
1388 | #ifdef HAVE_KWALLET | ||||
1388 | // if the file didn't open correctly it might be encrypted, so ask for a pass | 1389 | // if the file didn't open correctly it might be encrypted, so ask for a pass | ||
1389 | QString walletName, walletFolder, walletKey; | 1390 | QString walletName, walletFolder, walletKey; | ||
1390 | m_document->walletDataForFile(fileNameToOpen, &walletName, &walletFolder, &walletKey); | 1391 | m_document->walletDataForFile(fileNameToOpen, &walletName, &walletFolder, &walletKey); | ||
1391 | bool firstInput = true; | 1392 | bool firstInput = true; | ||
1392 | bool triedWallet = false; | 1393 | bool triedWallet = false; | ||
1393 | KWallet::Wallet * wallet = nullptr; | 1394 | KWallet::Wallet * wallet = nullptr; | ||
1394 | bool keep = true; | 1395 | bool keep = true; | ||
1395 | while ( openResult == Document::OpenNeedsPassword ) | 1396 | while ( openResult == Document::OpenNeedsPassword ) | ||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 1453 | { | |||
1454 | 1455 | | |||
1455 | // 3. if the password is correct and the user chose to remember it, store it to the wallet | 1456 | // 3. if the password is correct and the user chose to remember it, store it to the wallet | ||
1456 | if (wallet && /*safety check*/ wallet->isOpen() && keep ) | 1457 | if (wallet && /*safety check*/ wallet->isOpen() && keep ) | ||
1457 | { | 1458 | { | ||
1458 | wallet->writePassword( walletKey, password ); | 1459 | wallet->writePassword( walletKey, password ); | ||
1459 | } | 1460 | } | ||
1460 | } | 1461 | } | ||
1461 | } | 1462 | } | ||
1463 | #endif | ||||
1462 | } | 1464 | } | ||
1463 | 1465 | | |||
1464 | if ( openResult == Document::OpenSuccess ) | 1466 | if ( openResult == Document::OpenSuccess ) | ||
1465 | { | 1467 | { | ||
1466 | m_fileLastModified = QFileInfo( localFilePath() ).lastModified(); | 1468 | m_fileLastModified = QFileInfo( localFilePath() ).lastModified(); | ||
1467 | } | 1469 | } | ||
1468 | return openResult; | 1470 | return openResult; | ||
1469 | } | 1471 | } | ||
▲ Show 20 Lines • Show All 2079 Lines • Show Last 20 Lines |