summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold Dumas <[email protected]>2014-11-19 16:31:57 +0100
committerArnold Dumas <[email protected]>2014-11-19 16:31:57 +0100
commit2a81ff8062775cc508033dd40c7ed9f948d62694 (patch)
tree44e9ade03b4094b078b304b1a16a51c2b955e38f
parent8d1084a94ee0826091456d20fa1c53dd1ed0bdd2 (diff)
Port away from KIO::NetAccess::synchronousRun.
-rw-r--r--umbrello/docgenerators/docbookgenerator.cpp5
-rw-r--r--umbrello/docgenerators/xhtmlgenerator.cpp9
-rw-r--r--umbrello/umldoc.cpp5
3 files changed, 15 insertions, 4 deletions
diff --git a/umbrello/docgenerators/docbookgenerator.cpp b/umbrello/docgenerators/docbookgenerator.cpp
index edaf941..98c178e 100644
--- a/umbrello/docgenerators/docbookgenerator.cpp
+++ b/umbrello/docgenerators/docbookgenerator.cpp
@@ -21,6 +21,7 @@
#include <kmessagebox.h>
#include <kio/netaccess.h>
#include <kio/job.h>
+#include <kjobwidgets.h>
#include <QApplication>
#include <QFile>
@@ -104,7 +105,9 @@ void DocbookGenerator::slotDocbookGenerationFinished(const QString& tmpFileName)
url.setPath(m_destDir.path() + QLatin1Char('/') + fileName);
KIO::Job* job = KIO::file_copy(QUrl(tmpFileName), url, -1, KIO::Overwrite | KIO::HideProgressInfo);
- if (KIO::NetAccess::synchronousRun(job, (QWidget*)UMLApp::app())) {
+ KJobWidgets::setWindow(job, (QWidget*)UMLApp::app());
+ job->exec();
+ if (!job->error()) {
m_umlDoc->writeToStatusBar(i18n("Docbook Generation Complete..."));
m_pStatus = true;
} else {
diff --git a/umbrello/docgenerators/xhtmlgenerator.cpp b/umbrello/docgenerators/xhtmlgenerator.cpp
index 724d0a8..b51f629 100644
--- a/umbrello/docgenerators/xhtmlgenerator.cpp
+++ b/umbrello/docgenerators/xhtmlgenerator.cpp
@@ -22,6 +22,7 @@
#include <kmessagebox.h>
#include <kio/netaccess.h>
#include <kio/job.h>
+#include <kjobwidgets.h>
#include <QApplication>
#include <QFile>
@@ -127,7 +128,9 @@ void XhtmlGenerator::slotHtmlGenerated(const QString& tmpFileName)
url.setPath(m_destDir.path() + QLatin1Char('/') + fileName);
KIO::Job* htmlCopyJob = KIO::file_copy(QUrl::fromLocalFile(tmpFileName), url, -1, KIO::Overwrite | KIO::HideProgressInfo);
- if (KIO::NetAccess::synchronousRun(htmlCopyJob, (QWidget*)UMLApp::app())) {
+ KJobWidgets::setWindow(htmlCopyJob, (QWidget*)UMLApp::app());
+ htmlCopyJob->exec();
+ if (!htmlCopyJob->error()) {
m_umlDoc->writeToStatusBar(i18n("XHTML Generation Complete..."));
} else {
m_pStatus = false;
@@ -141,7 +144,9 @@ void XhtmlGenerator::slotHtmlGenerated(const QString& tmpFileName)
cssUrl.setPath(cssUrl.path() + QLatin1Char('/') + QLatin1String("xmi.css"));
KIO::Job* cssJob = KIO::file_copy(QUrl::fromLocalFile(cssFileName), cssUrl, -1, KIO::Overwrite | KIO::HideProgressInfo);
- if (KIO::NetAccess::synchronousRun(cssJob, (QWidget*)UMLApp::app())) {
+ KJobWidgets::setWindow(cssJob, (QWidget*)UMLApp::app());
+ cssJob->exec();
+ if (!cssJob->error()) {
m_umlDoc->writeToStatusBar(i18n("Finished Copying CSS..."));
m_pStatus = true;
} else {
diff --git a/umbrello/umldoc.cpp b/umbrello/umldoc.cpp
index 7969303..ad12578 100644
--- a/umbrello/umldoc.cpp
+++ b/umbrello/umldoc.cpp
@@ -52,6 +52,7 @@
#include <kmessagebox.h>
#include <kmimetype.h>
#include <ktar.h>
+#include <kjobwidgets.h>
// qt includes
#include <QApplication>
@@ -719,7 +720,9 @@ bool UMLDoc::saveDocument(const QUrl& url, const char * format)
#else
KIO::FileCopyJob* fcj = KIO::file_move(QUrl::fromLocalFile(tmpfile.fileName()), url, -1, KIO::Overwrite);
#endif
- if (KIO::NetAccess::synchronousRun(fcj, (QWidget*)UMLApp::app()) == false) {
+ KJobWidgets::setWindow(fcj, (QWidget*)UMLApp::app());
+ fcj->exec();
+ if (fcj->error()) {
KMessageBox::error(0, i18n("There was a problem saving file: %1", url.url(QUrl::PreferLocalFile)), i18n("Save Error"));
setFileName(m_doc_url, i18n("Untitled"));
return false;