Commit bf8469b0 authored by Halla Rempt's avatar Halla Rempt

Remove more places where we used KIO

parent 74aad24e
......@@ -40,6 +40,7 @@ extern "C" {
#include <QMessageBox>
#include <klocale.h>
#include <kurl.h>
#include <KoDocumentInfo.h>
#include <KoColorSpace.h>
......@@ -111,11 +112,10 @@ QString getColorSpaceModelForColorType(J_COLOR_SPACE color_type)
}
KisJPEGConverter::KisJPEGConverter(KisDocument *doc, bool batchMode)
: m_doc(doc)
, m_stop(false)
, m_batchMode(batchMode)
{
m_doc = doc;
m_job = 0;
m_stop = false;
m_batchMode = batchMode;
}
KisJPEGConverter::~KisJPEGConverter()
......
......@@ -26,12 +26,9 @@ extern "C" {
#include <jpeglib.h>
}
#include <QColor>
#include <QVector>
#include <kio/job.h>
#include "kis_types.h"
#include "kis_annotation.h"
class KisDocument;
......@@ -101,7 +98,6 @@ private:
KisImageWSP m_image;
KisDocument *m_doc;
bool m_stop;
KIO::TransferJob *m_job;
bool m_batchMode;
};
......
......@@ -19,6 +19,8 @@
#include <QApplication>
#include <kurl.h>
#include <KoStore.h>
#include <KoStoreDevice.h>
......@@ -33,10 +35,9 @@
#include "ora_save_context.h"
OraConverter::OraConverter(KisDocument *doc)
: m_doc(doc)
, m_stop(false)
{
m_doc = doc;
m_job = 0;
m_stop = false;
}
OraConverter::~OraConverter()
......
......@@ -22,8 +22,6 @@
#include <QObject>
#include <kio/job.h>
#include "kis_png_converter.h"
#include "kis_types.h"
......@@ -50,7 +48,6 @@ private:
KisDocument *m_doc;
vKisNodeSP m_activeNodes;
bool m_stop;
KIO::TransferJob *m_job;
};
#endif
......@@ -19,9 +19,10 @@
#include <QCheckBox>
#include <QSlider>
#include <QMessageBox>
#include <kpluginfactory.h>
#include <QMessageBox>
#include <kurl.h>
#include <KisFilterChain.h>
#include <KisImportExportManager.h>
......
......@@ -18,6 +18,7 @@
#include "ora_import.h"
#include <kpluginfactory.h>
#include <kurl.h>
#include <KisFilterChain.h>
......
......@@ -19,9 +19,10 @@
#include <QCheckBox>
#include <QSlider>
#include <QMessageBox>
#include <kpluginfactory.h>
#include <QMessageBox>
#include <kurl.h>
#include <KisImportExportManager.h>
#include <KisFilterChain.h>
......
......@@ -18,6 +18,7 @@
#include "psd_import.h"
#include <kpluginfactory.h>
#include <kurl.h>
#include <KisFilterChain.h>
......
......@@ -19,6 +19,8 @@
#include <QApplication>
#include <kurl.h>
#include <KoColorSpace.h>
#include <KoColorSpaceRegistry.h>
#include <KoColorModelStandardIds.h>
......@@ -50,11 +52,10 @@
#include "psd_image_data.h"
PSDLoader::PSDLoader(KisDocument *doc)
: m_image(0)
, m_doc(doc)
, m_stop(false)
{
m_image = 0;
m_doc = doc;
m_job = 0;
m_stop = false;
}
PSDLoader::~PSDLoader()
......
......@@ -22,8 +22,6 @@
#include <QObject>
#include <kio/job.h>
#include "kis_types.h"
class KisDocument;
......@@ -73,7 +71,6 @@ private:
KisImageWSP m_image;
KisDocument *m_doc;
bool m_stop;
KIO::TransferJob *m_job;
};
#endif
......@@ -23,6 +23,8 @@
#include <KoCompositeOp.h>
#include <KoUnit.h>
#include <kurl.h>
#include <kis_annotation.h>
#include <kis_types.h>
#include <kis_paint_layer.h>
......@@ -83,11 +85,10 @@ QPair<psd_color_mode, quint16> colormodelid_to_psd_colormode(const QString &colo
PSDSaver::PSDSaver(KisDocument *doc)
: m_doc(doc)
, m_image(doc->image())
, m_stop(false)
{
m_doc = doc;
m_image = doc->image();
m_job = 0;
m_stop = false;
}
PSDSaver::~PSDSaver()
......
......@@ -22,8 +22,6 @@
#include <QObject>
#include <kio/job.h>
#include "kis_types.h"
class KisDocument;
......@@ -71,7 +69,6 @@ private:
KisImageWSP m_image;
KisDocument *m_doc;
bool m_stop;
KIO::TransferJob *m_job;
};
#endif
......@@ -22,8 +22,6 @@
#include <QObject>
// #include <kio/job.h>
#include "kis_types.h"
/**
......
......@@ -24,12 +24,11 @@
#include <QFile>
#include <QApplication>
#include <kurl.h>
#include <KoDocumentInfo.h>
#include <KoUnit.h>
#include <kio/netaccess.h>
#include <kio/deletejob.h>
#include <KoColorSpaceRegistry.h>
#include <KoColorSpace.h>
#include <KoColorModelStandardIds.h>
......@@ -169,7 +168,6 @@ QPair<QString, QString> getColorSpaceForColorType(uint16 sampletype, uint16 colo
KisTIFFConverter::KisTIFFConverter(KisDocument *doc)
{
m_doc = doc;
m_job = 0;
m_stop = false;
TIFFSetWarningHandler(0);
......@@ -668,13 +666,11 @@ KisImageBuilder_Result KisTIFFConverter::buildFile(const KUrl& uri, KisImageWSP
KisGroupLayer* root = dynamic_cast<KisGroupLayer*>(kisimage->rootLayer().data());
if (root == 0) {
KIO::del(uri);
TIFFClose(image);
return KisImageBuilder_RESULT_FAILURE;
}
KisTIFFWriterVisitor* visitor = new KisTIFFWriterVisitor(image, &options);
if (!visitor->visit(root)) {
KIO::del(uri);
TIFFClose(image);
return KisImageBuilder_RESULT_FAILURE;
}
......
......@@ -25,10 +25,6 @@
#include <QVector>
#include <kio/job.h>
#include "kis_types.h"
#include "kis_global.h"
#include "kis_annotation.h"
......@@ -86,7 +82,6 @@ private:
KisImageWSP m_image;
KisDocument *m_doc;
bool m_stop;
KIO::TransferJob *m_job;
};
#endif
......@@ -53,18 +53,15 @@
#include <kmimetype.h>
#include <kfileitem.h>
#include <kio/netaccess.h>
#include <kio/job.h>
#include <klocale.h>
#include <ksavefile.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kdesktopfile.h>
#include <kconfiggroup.h>
#include <kio/job.h>
#include <kfileitem.h>
#include <kio/netaccess.h>
#include <kio/job.h>
#include <kfileitem.h>
#include <kio/netaccess.h>
#include <kdirnotify.h>
#include <ktemporaryfile.h>
#include "kundo2stack.h"
......@@ -1533,6 +1530,7 @@ bool KisDocument::oldLoadAndParse(KoStore *store, const QString& filename, KoXml
// Error variables for QDomDocument::setContent
QString errorMsg;
int errorLine, errorColumn;
qDebug() << store->device()->readAll();
bool ok = doc.setContent(store->device(), &errorMsg, &errorLine, &errorColumn);
store->close();
if (!ok) {
......
......@@ -61,7 +61,6 @@
#include <kfileitem.h>
#include <kglobalsettings.h>
#include <khelpmenu.h>
#include <kio/netaccess.h>
#include <klocale.h>
#include <kmenubar.h>
#include <kmenu.h>
......@@ -692,7 +691,7 @@ KisView *KisMainWindow::activeView() const
bool KisMainWindow::openDocument(const KUrl & url)
{
if (!KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, 0)) {
if (!QFile(url.toLocalFile()).exists()) {
QMessageBox::critical(0, i18nc("@title:window", "Krita"), i18n("The file %1 does not exist.", url.url()));
d->recentFiles->removeUrl(url); //remove the file from the recent-opened-file-list
saveRecentFiles();
......
......@@ -48,11 +48,9 @@
#include <QMessageBox>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <kio/netaccess.h>
#include <kiconloader.h>
#include <kaboutdata.h>
#include <kconfiggroup.h>
#include <kio/job.h>
#include <kcomponentdata.h>
#include <kis_factory2.h>
......@@ -301,39 +299,38 @@ void KisTemplateCreateDia::slotOk() {
KUrl dest;
dest.setPath(templateDir+file+ext);
if ( QFile::exists( dest.pathOrUrl() ) )
{
do
{
if (QFile::exists( dest.pathOrUrl())) {
do {
file.prepend( '_' );
dest.setPath( templateDir + file + ext );
tmpIcon=".icon/"+file+".png";
icon=iconDir+file+".png";
tmpIcon=".icon/" + file + ".png";
icon=iconDir + file + ".png";
}
while ( KIO::NetAccess::exists( dest, KIO::NetAccess::DestinationSide, this ) );
while (QFile(dest.toLocalFile()).exists());
}
bool ignore = false;
kDebug(30004) <<"Trying to create template:" << d->m_name->text() <<"URL=" <<".source/"+file+ext <<" ICON=" << tmpIcon;
KisTemplate *t=new KisTemplate(d->m_name->text(), QString(), ".source/"+file+ext, tmpIcon, "", "", false, true);
if(!group->add(t)) {
if (!group->add(t)) {
KisTemplate *existingTemplate=group->find(d->m_name->text());
if(existingTemplate && !existingTemplate->isHidden()) {
if (existingTemplate && !existingTemplate->isHidden()) {
if (QMessageBox::warning(this,
i18nc("@title:window", "Krita"),
i18n("Do you really want to overwrite the existing '%1' template?", existingTemplate->name()),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) {
group->add(t, true);
else
{
}
else {
delete t;
return;
}
}
else
else {
ignore = true;
}
}
if(!KStandardDirs::makeDir(templateDir) || !KStandardDirs::makeDir(iconDir)) {
if (!KStandardDirs::makeDir(templateDir) || !KStandardDirs::makeDir(iconDir)) {
d->m_tree->writeTemplateTree();
slotButtonClicked( KDialog::Cancel );
return;
......@@ -363,13 +360,13 @@ void KisTemplateCreateDia::slotOk() {
if((*it).contains(dir)==0) {
orig.setPath( (*it)+".directory" );
// Check if we can read the file
if( KIO::NetAccess::exists(orig, KIO::NetAccess::SourceSide, this) ) {
dest.setPath( dir+"/.directory" );
if (QFile(orig.toLocalFile()).exists()) {
dest.setPath(dir + "/.directory");
// We copy the file with overwrite
KIO::FileCopyJob *job = KIO::file_copy( orig, dest, -1, KIO::Overwrite | KIO::HideProgressInfo);
job->exec();
ready=true;
if (!QFile(orig.toLocalFile()).copy(dest.toLocalFile())) {
qWarning() << "Failed to copy from" << orig.toLocalFile() << "to" << dest.toLocalFile();
}
ready = true;
}
}
}
......
......@@ -46,7 +46,6 @@
#include <kactioncollection.h>
#include <kaction.h>
#include <kio/netaccess.h>
#include <klocale.h>
#include <kmenubar.h>
#include <kmenu.h>
......@@ -992,7 +991,7 @@ void KisViewManager::slotSaveIncremental()
newVersion.append(".");
}
fileName.replace(regex, newVersion);
fileAlreadyExists = KIO::NetAccess::exists(fileName, KIO::NetAccess::DestinationSide, mainWindow());
fileAlreadyExists = QFile(fileName).exists();
if (fileAlreadyExists) {
if (!letter.isNull()) {
char letterCh = letter.at(0).toLatin1();
......@@ -1063,7 +1062,7 @@ void KisViewManager::slotSaveIncrementalBackup()
if (!letter.isNull()) newVersion.append(letter);
newVersion.append(".");
backupFileName.replace(regex, newVersion);
fileAlreadyExists = KIO::NetAccess::exists(backupFileName, KIO::NetAccess::DestinationSide, mainWindow());
fileAlreadyExists = QFile(backupFileName).exists();
if (fileAlreadyExists) {
if (!letter.isNull()) {
char letterCh = letter.at(0).toLatin1();
......@@ -1103,7 +1102,7 @@ void KisViewManager::slotSaveIncrementalBackup()
newVersion.prepend("~");
newVersion.append(".");
backupFileName.replace(regex, newVersion);
fileAlreadyExists = KIO::NetAccess::exists(backupFileName, KIO::NetAccess::DestinationSide, mainWindow());
fileAlreadyExists = QFile(backupFileName).exists();
if (fileAlreadyExists) {
// Prepare the base for new version filename, increment by 1
int intVersion = baseNewVersion.toInt(0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment