Commit 00d30464 authored by Davide Gianforte's avatar Davide Gianforte
Browse files

[krusader/VFS] done with VFS submodule

some TODOs left
parent 97cc44da
......@@ -47,6 +47,7 @@ find_package(KF5 REQUIRED COMPONENTS
DocTools
KDELibs4Support
Parts
Wallet
)
set(CMAKE_VERBOSE_MAKEFILE OFF)
......
include_directories(${KF5_INCLUDES_DIRS} ${QT_INCLUDES})
set(VFS_SRCS
vfilecontainer.cpp
krvfshandler.cpp
......@@ -18,5 +20,5 @@ set(VFS_SRCS
add_library(VFS STATIC ${VFS_SRCS})
if(ACL_FOUND)
target_link_libraries(VFS ${ACL_LIBS})
target_link_libraries(VFS KF5::Archive KF5::KIOCore KF5::KDELibs4Support KF5::Wallet ${ACL_LIBS})
endif(ACL_FOUND)
......@@ -183,7 +183,9 @@ bool AbstractThreadedJob::event(QEvent *e)
break;
case CMD_MESSAGE: {
QString message = event->args()[ 0 ].value<QString>();
KMessageBox::information(ui() ? ui()->window() : 0, message);
KIO::JobUiDelegate *jobui = new KIO::JobUiDelegate();
//jobui->setJob(job);
KMessageBox::information(ui() ? jobui->window() : 0, message);
QList<QVariant> *resultResp = new QList<QVariant> ();
addEventResponse(resultResp);
}
......@@ -495,8 +497,11 @@ void AbstractJobThread::calcSpaceLocal(const KUrl &baseUrl, const QStringList &
sendReset(i18n("Calculating space"));
vfs *calcSpaceVfs = KrVfsHandler::getVfs(baseUrl);
if(_job->ui())
calcSpaceVfs->setParentWindow(_job->ui()->window());
if(_job->ui()) {
KIO::JobUiDelegate *jobui = new KIO::JobUiDelegate();
jobui->setJob(_job);
calcSpaceVfs->setParentWindow(jobui->window());
}
calcSpaceVfs->vfs_refresh(baseUrl);
for (int i = 0; i != files.count(); i++) {
......
......@@ -200,8 +200,11 @@ bool ftp_vfs::populateVfsList(const KUrl& origin, bool showHidden)
connect(job, SIGNAL(result(KJob*)),
this, SLOT(slotListResult(KJob*)));
if(!parentWindow.isNull())
job->ui()->setWindow(parentWindow);
if(!parentWindow.isNull()) {
KIO::JobUiDelegate *jobui = new KIO::JobUiDelegate();
jobui->setJob(job);
jobui->setWindow(parentWindow);
}
if (!quietMode) {
emit startJob(job);
......
......@@ -39,7 +39,7 @@
#include <KDE/KStandardDirs>
#include <KWidgetsAddons/KMessageBox>
#include <KWidgetAddons/KPasswordDialog>
#include <KWidgetsAddons/KPasswordDialog>
#include <KArchive/KTar>
#include <KIO/Global>
......
......@@ -41,7 +41,7 @@
#include <KIOWidgets/KUrlCompletion>
#include <KIO/Job>
#include <KIO/KFileItem>
#include <KIOCore/KFileItem>
#include "vfs.h"
#include "krarchandler.h"
......@@ -166,8 +166,9 @@ void KRQuery::load(KConfigGroup cfg)
LOAD("InArchive", inArchive);
LOAD("Recurse", recurse);
LOAD("FollowLinks", followLinksP);
LOAD("WhereToSearch", whereToSearch);
LOAD("WhereNotToSearch", whereNotToSearch);
// KF5 TODO?
//LOAD("WhereToSearch", whereToSearch);
//LOAD("WhereNotToSearch", whereNotToSearch);
LOAD("OrigFilter", origFilter);
codec = QTextCodec::codecForName(cfg.readEntry("Codec", codec->name()));
......@@ -211,8 +212,9 @@ void KRQuery::save(KConfigGroup cfg)
cfg.writeEntry("InArchive", inArchive);
cfg.writeEntry("Recurse", recurse);
cfg.writeEntry("FollowLinks", followLinksP);
cfg.writeEntry("WhereToSearch", whereToSearch);
cfg.writeEntry("WhereNotToSearch", whereNotToSearch);
// KF5 TODO?
//cfg.writeEntry("WhereToSearch", whereToSearch);
//cfg.writeEntry("WhereNotToSearch", whereNotToSearch);
cfg.writeEntry("OrigFilter", origFilter);
cfg.writeEntry("Codec", codec->name());
......
......@@ -37,7 +37,7 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KUrl>
#include <KIO/KFileItem>
#include <KIOCore/KFileItem>
#include <KCoreAddons/KDirWatch>
#include "vfs.h"
......
......@@ -36,6 +36,9 @@
#include <QtCore/QMap>
#include <QtCore/QList>
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KUrl>
#include <KIO/JobClasses>
#include <KIO/CopyJob>
......
......@@ -36,6 +36,7 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KMimeType>
#include <KDE/KUrl>
#include <KIO/Global>
#include <KIO/UDSEntry>
......
......@@ -311,7 +311,7 @@ KConfig* virt_vfs::getVirtDB()
{
if (!virt_vfs_db) {
// virt_vfs_db = new KConfig("data",VIRT_VFS_DB,KConfig::NoGlobals);
virt_vfs_db = new KConfig(VIRT_VFS_DB, KConfig:: CascadeConfig, "data");
virt_vfs_db = new KConfig(VIRT_VFS_DB, KConfig:: CascadeConfig, QStandardPaths::DataLocation);
}
return virt_vfs_db;
}
......
......@@ -71,7 +71,7 @@ public:
if (copyJobRef->isMulti())
mmode = (KIO::RenameDialog_Mode)(mmode | KIO::M_MULTI | KIO::M_SKIP);
else
mmode = (KIO::RenameDialog_Mode)(mmode | KIO::M_SINGLE);
mmode = (KIO::RenameDialog_Mode)(mmode /*| KIO::M_SINGLE*/);
if (mode & KIO::M_OVERWRITE)
mmode = (KIO::RenameDialog_Mode)(mmode | KIO::M_OVERWRITE);
......@@ -79,7 +79,8 @@ public:
mmode = (KIO::RenameDialog_Mode)(mmode | KIO::M_OVERWRITE_ITSELF);
KIO::RenameDialog_Result res = KIO::JobUiDelegate::askFileRename(job, caption, src, dest, mode, newDest,
sizeSrc, sizeDest, ctimeSrc, ctimeDest, mtimeSrc, mtimeDest);
sizeSrc, sizeDest, QDateTime::fromTime_t(ctimeSrc), QDateTime::fromTime_t(ctimeDest),
QDateTime::fromTime_t(mtimeSrc), QDateTime::fromTime_t(mtimeDest));
if (res == KIO::R_AUTO_SKIP) {
copyJobRef->setSkipAll();
......@@ -102,7 +103,8 @@ public:
return KIO::S_SKIP;
}
KIO::SkipDialog_Result res = KIO::JobUiDelegate::askSkip(job, copyJobRef->isMulti(), error_text);
//KIO::SkipDialog_Result res = KIO::JobUiDelegate::askSkip(job, copyJobRef->isMulti(), error_text);
KIO::SkipDialog_Result res = KIO::JobUiDelegate::askSkip(job, KIO::SkipDialog_MultipleItems, error_text);
if (res == KIO::S_AUTO_SKIP) {
copyJobRef->setSkipAll();
if (!multi)
......@@ -297,8 +299,9 @@ void VirtualCopyJob::slotMkdirResult(KJob *job)
if (job && job->error()) {
if (ui() && !m_skipAll) {
KIO::SkipDialog_Result skipResult = ui()->askSkip(this, m_multi,
job->errorString());
KIO::JobUiDelegate *jobui = new KIO::JobUiDelegate();
jobui->setJob(job);
KIO::SkipDialog_Result skipResult = jobui->askSkip(job, KIO::SkipDialog_MultipleItems, job->errorString());
switch (skipResult) {
case KIO::S_CANCEL:
setError(KIO::ERR_USER_CANCELED);
......
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