Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/csvexport/csvexporterplugin.cpp
Context not available. | |||||
29 | 29 | | |||
---|---|---|---|---|---|
30 | #include <KActionCollection> | 30 | #include <KActionCollection> | ||
31 | #include <KLocalizedString> | 31 | #include <KLocalizedString> | ||
32 | #include <KMessageBox> | ||||
33 | #include <KIO/StatJob> | ||||
32 | 34 | | |||
33 | // ---------------------------------------------------------------------------- | 35 | // ---------------------------------------------------------------------------- | ||
34 | // Project Includes | 36 | // Project Includes | ||
Context not available. | |||||
79 | // check if the file exists and warn the user | 81 | // check if the file exists and warn the user | ||
80 | bool reallySaveFile = true; | 82 | bool reallySaveFile = true; | ||
81 | 83 | | |||
82 | // TODO: port this to KF5 (NetAccess) | 84 | bool fileExists = false; | ||
83 | #if 0 | 85 | if (url.isValid()) { | ||
84 | if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, 0)) { | 86 | short int detailLevel = 0; // Lowest level: file/dir/symlink/none | ||
87 | KIO::StatJob* statjob = KIO::stat(url, KIO::StatJob::SourceSide, detailLevel); | ||||
88 | bool noerror = statjob->exec(); | ||||
89 | if (noerror) { | ||||
90 | // We want a file | ||||
91 | fileExists = !statjob->statResult().isDir(); | ||||
92 | } | ||||
93 | } | ||||
94 | | ||||
95 | if (fileExists) { | ||||
85 | if (KMessageBox::warningYesNo(0, QString("<qt>") + i18n("The file <b>%1</b> already exists. Do you really want to overwrite it?", url.toDisplayString(QUrl::PreferLocalFile)) + QString("</qt>"), i18n("File already exists")) != KMessageBox::Yes) | 96 | if (KMessageBox::warningYesNo(0, QString("<qt>") + i18n("The file <b>%1</b> already exists. Do you really want to overwrite it?", url.toDisplayString(QUrl::PreferLocalFile)) + QString("</qt>"), i18n("File already exists")) != KMessageBox::Yes) | ||
86 | reallySaveFile = false; | 97 | reallySaveFile = false; | ||
87 | } | 98 | } | ||
88 | #endif | | |||
89 | return reallySaveFile; | 99 | return reallySaveFile; | ||
90 | } | 100 | } | ||
Context not available. |