Commit 04db18bc authored by camilo higuita's avatar camilo higuita

working on windows

parent 8b1fc660
......@@ -11,9 +11,6 @@ CONFIG *= c++17
DEFINES *= \
MAUI_APP \
STATIC_MAUIKIT \
ANDROID_OPENSSL \
MAUIKIT_STYLE
#REPO VARIABLES
LUV_REPO = https://github.com/milohr/luv-icon-theme
......@@ -33,21 +30,26 @@ linux:unix:!android {
message(Building Maui helpers for Linux KDE)
include($$PWD/src/kde/kde.pri)
} else:android {
} else:android|win32 {
message(Building Maui helpers for Android)
message(Building Maui helpers for Android or Windows)
include($$PWD/src/android/android.pri)
android {
include($$PWD/src/android/android.pri)
contains(DEFINES, ANDROID_OPENSSL):{
exists($$PWD/src/utils/syncing/openssl/openssl.pri) {
message("Using OpenSSL for Android")
include($$PWD/src/utils/syncing/openssl/openssl.pri)
}else {
message("Getting OpenSSL for Android")
system(git clone $$OPENSSL_REPO $$PWD/src/utils/syncing/openssl)
include($$PWD/src/utils/syncing/openssl/openssl.pri)
contains(DEFINES, ANDROID_OPENSSL):{
exists($$PWD/src/utils/syncing/openssl/openssl.pri) {
message("Using OpenSSL for Android")
include($$PWD/src/utils/syncing/openssl/openssl.pri)
}else {
message("Getting OpenSSL for Android")
system(git clone $$OPENSSL_REPO $$PWD/src/utils/syncing/openssl)
include($$PWD/src/utils/syncing/openssl/openssl.pri)
}
}
}else:win32 {
}
contains(DEFINES, COMPONENT_EDITOR):{
......@@ -56,7 +58,7 @@ linux:unix:!android {
contains(DEFINES, COMPONENT_STORE):{
exists($$PWD/src/utils/store/attica/attica.pri):{
message("Using Attica for Android")
message("Using Attica for Android or Windows")
include($$PWD/src/utils/store/attica/attica.pri)
}else {
message("Getting Attica for Android")
......@@ -65,14 +67,22 @@ linux:unix:!android {
}
}
contains(DEFINES, COMPONENT_SYNCING):{
include($$PWD/src/utils/syncing/libwebdavclient/webdavclient.pri)
}
} else {
message("Unknown configuration")
}
contains(DEFINES, MAUIKIT_STYLE):{
exists($$PWD/src/maui-style/icons/luv-icon-theme) {
message("Using Luv icon theme")
}else {
message("Getting Luv icon theme")
system(git clone $$LUV_REPO $$PWD/src/maui-style/icons/luv-icon-theme)
}
RESOURCES += $$PWD/src/maui-style/icons.qrc \
$$PWD/src/maui-style/style.qrc
}
contains(DEFINES, COMPONENT_TAGGING):{
message("INCLUDING TAGGING COMPONENT")
include($$PWD/src/utils/tagging/tagging.pri)
......@@ -119,6 +129,8 @@ contains(DEFINES, COMPONENT_STORE):{
contains(DEFINES, COMPONENT_SYNCING):{
message("INCLUDING SYNCING COMPONENT")
include($$PWD/src/utils/syncing/libwebdavclient/webdavclient.pri)
HEADERS += $$PWD/src/utils/syncing/syncing.h
SOURCES += $$PWD/src/utils/syncing/syncing.cpp
INCLUDEPATH += $$PWD/src/utils/syncing
......@@ -128,7 +140,7 @@ contains(DEFINES, COMPONENT_SYNCING):{
contains(DEFINES, COMPONENT_ACCOUNTS):{
message("INCLUDING ACCOUNTS COMPONENT")
QT += sql
QT *= sql
HEADERS += \
$$PWD/src/utils/accounts/mauiaccounts.h \
$$PWD/src/utils/accounts/accountsdb.h \
......@@ -152,12 +164,15 @@ contains(DEFINES, COMPONENT_FM):{
HEADERS += \
$$PWD/src/fm/fm.h \
$$PWD/src/fm/fmlist.h \
$$PWD/src/fm/placeslist.h
$$PWD/src/fm/placeslist.h \
$$PWD/src/fm/downloader.h
SOURCES += \
$$PWD/src/fm/fm.cpp \
$$PWD/src/fm/fmlist.cpp \
$$PWD/src/fm/placeslist.cpp
$$PWD/src/fm/placeslist.cpp \
$$PWD/src/fm/downloader.cpp
INCLUDEPATH += $$PWD/src/fm
DEPENDPATH += $$PWD/src/fm
......@@ -167,8 +182,7 @@ contains(DEFINES, COMPONENT_FM):{
RESOURCES += \
$$PWD/src/mauikit.qrc \
$$PWD/src/assets.qrc \
$$PWD/src/maui-style/style.qrc
$$PWD/src/assets.qrc
HEADERS += \
$$PWD/src/utils/fmstatic.h \
......
......@@ -23,16 +23,6 @@ INCLUDEPATH += \
# error("The application is missing the android files, this files are supossed to be located at $$ANDROID_FILES_DIR")
#}
contains(DEFINES, MAUIKIT_STYLE):{
exists($$PWD/icons/luv-icon-theme) {
message("Using Luv icon theme for Android")
}else {
message("Getting Luv icon theme for Android")
system(git clone $$LUV_REPO $$PWD/icons/luv-icon-theme)
}
RESOURCES += $$PWD/icons.qrc
}
RESOURCES += \
$$PWD/android.qrc
......
#include "downloader.h"
FMH::Downloader::Downloader(QObject *parent) : QObject(parent), manager(new QNetworkAccessManager)
{}
FMH::Downloader::~Downloader()
{
qDebug()<< "DELETEING DOWNLOADER";
this->manager->deleteLater();
// this->reply->deleteLater();
}
void FMH::Downloader::setFile(const QString &fileURL, const QString &fileName)
{
QString filePath = fileURL;
if(fileName.isEmpty() || fileURL.isEmpty())
return;
QNetworkRequest request;
request.setUrl(QUrl(fileURL));
reply = manager->get(request);
file = new QFile;
file->setFileName(fileName);
file->open(QIODevice::WriteOnly);
connect(reply, SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(onDownloadProgress(qint64,qint64)));
connect(manager, SIGNAL(finished(QNetworkReply*)),this,SLOT(onFinished(QNetworkReply*)));
connect(reply, SIGNAL(readyRead()),this,SLOT(onReadyRead()));
connect(reply, SIGNAL(finished()),this,SLOT(onReplyFinished()));
}
void FMH::Downloader::getArray(const QString &fileURL, const QMap<QString, QString> &headers)
{
qDebug() << fileURL << headers;
if(fileURL.isEmpty())
return;
QNetworkRequest request;
request.setUrl(QUrl(fileURL));
if(!headers.isEmpty())
{
for(auto key: headers.keys())
request.setRawHeader(key.toLocal8Bit(), headers[key].toLocal8Bit());
}
reply = manager->get(request);
connect(reply, &QNetworkReply::readyRead, [this]()
{
switch(reply->error())
{
case QNetworkReply::NoError:
{
this->array = reply->readAll();
break;
}
default:
{
qDebug() << reply->errorString();
emit this->warning(reply->errorString());
};
}
});
connect(reply, &QNetworkReply::finished, [=]()
{
qDebug() << "Array reply is now finished";
emit this->dataReady(this->array);
emit this->done();
});
}
void FMH::Downloader::onDownloadProgress(qint64 bytesRead, qint64 bytesTotal)
{
emit this->progress((bytesRead * bytesTotal) / 100);
}
void FMH::Downloader::onFinished(QNetworkReply *reply)
{
switch(reply->error())
{
case QNetworkReply::NoError:
{
qDebug("file is downloaded successfully.");
emit this->downloadReady();
break;
}
default:
{
emit this->warning(reply->errorString());
};
}
if(file->isOpen())
{
file->close();
emit this->fileSaved(file->fileName());
file->deleteLater();
}
}
void FMH::Downloader::onReadyRead()
{
file->write(reply->readAll());
// emit this->fileSaved(file->fileName());
}
void FMH::Downloader::onReplyFinished()
{
if(file->isOpen())
{
file->close();
// emit this->fileSaved(file->fileName());
file->deleteLater();
}
emit done();
}
#ifndef DOWNLOADER_H
#define DOWNLOADER_H
#include <QObject>
#include <QNetworkReply>
#include <QNetworkAccessManager>
#include <QString>
#include <QFile>
#ifndef STATIC_MAUIKIT
#include "mauikit_export.h"
#endif
namespace FMH
{
#ifdef STATIC_MAUIKIT
class Downloader : public QObject
#else
class MAUIKIT_EXPORT Downloader : public QObject
#endif
{
Q_OBJECT
public:
Downloader(QObject *parent = nullptr);
virtual ~Downloader();
void setFile(const QString &fileURL, const QString &fileName = QString());
void getArray(const QString &fileURL, const QMap<QString, QString> &headers = {});
private:
QNetworkAccessManager *manager;
QNetworkReply *reply;
QFile *file;
QByteArray array;
signals:
void progress(int percent);
void downloadReady();
void fileSaved(QString path);
void warning(QString warning);
void dataReady(QByteArray array);
void done();
private slots:
void onDownloadProgress(qint64 bytesRead, qint64 bytesTotal);
void onFinished(QNetworkReply* reply);
void onReadyRead();
void onReplyFinished();
};
#endif // DOWNLOADER_H
}
......@@ -43,7 +43,7 @@
#if defined(Q_OS_ANDROID)
#include "mauiandroid.h"
#else
#elif Q_OS_LINUX
#include "mauikde.h"
#include <KFilePlacesModel>
#include <KIO/CopyJob>
......@@ -202,7 +202,7 @@ FM::FM(QObject *parent) : QObject(parent)
{
qDebug()<< "Getting async path contents";
#ifdef Q_OS_ANDROID
#if defined Q_OS_ANDROID || defined Q_OS_WIN32
QFutureWatcher<FMH::PATH_CONTENT> *watcher = new QFutureWatcher<FMH::PATH_CONTENT>;
connect(watcher, &QFutureWatcher<FMH::PATH_CONTENT>::finished, [this, watcher = std::move(watcher)]()
{
......@@ -257,9 +257,9 @@ FM::FM(QObject *parent) : QObject(parent)
FMH::MODEL_LIST FM::getAppsPath()
{
#ifdef Q_OS_ANDROID
#if defined Q_OS_ANDROID || defined Q_OS_WIN32
return FMH::MODEL_LIST();
#endif
#else
return FMH::MODEL_LIST
{
......@@ -271,6 +271,7 @@ FM::FM(QObject *parent) : QObject(parent)
{FMH::MODEL_KEY::TYPE, FMH::PATHTYPE_LABEL[FMH::PATHTYPE_KEY::PLACES_PATH]}
}
};
#endif
}
FMH::MODEL_LIST FM::getTags(const int &limit)
......
This diff is collapsed.
......@@ -27,7 +27,6 @@
<file>ScrollView.qml</file>
<file>Slider.qml</file>
<file>SpinBox.qml</file>
<file>style.qrc</file>
<file>SwipeView.qml</file>
<file>Switch.qml</file>
<file>SwitchDelegate.qml</file>
......
......@@ -60,11 +60,11 @@
#ifdef Q_OS_ANDROID
#include "mauiandroid.h"
#else
#elif defined Q_OS_LINUX
#include "mauikde.h"
#endif
#if defined Q_OS_ANDROID || defined APPIMAGE_PACKAGE || defined MAUIKIT_STYLE
#if defined MAUIKIT_STYLE
#include <QIcon>
#include <QQuickStyle>
#endif
......@@ -108,20 +108,21 @@ void MauiKit::registerTypes(const char *uri)
qmlRegisterType(componentUrl(QStringLiteral("Badge.qml")), uri, 1, 0, "Badge");
qmlRegisterType(componentUrl(QStringLiteral("GridView.qml")), uri, 1, 0, "GridView");
qmlRegisterType(componentUrl(QStringLiteral("ColorsBar.qml")), uri, 1, 0, "ColorsBar");
qmlRegisterType(componentUrl(QStringLiteral("ImageViewer.qml")), uri, 1, 0, "ImageViewer");
qmlRegisterType(componentUrl(QStringLiteral("TabBar.qml")), uri, 1, 0, "TabBar");
qmlRegisterType(componentUrl(QStringLiteral("TabButton.qml")), uri, 1, 0, "TabButton");
qmlRegisterType(componentUrl(QStringLiteral("ActionGroup.qml")), uri, 1, 0, "ActionGroup");
qmlRegisterType(componentUrl(QStringLiteral("ImageViewer.qml")), uri, 1, 0, "ImageViewer");
qmlRegisterType(componentUrl(QStringLiteral("TabBar.qml")), uri, 1, 0, "TabBar");
qmlRegisterType(componentUrl(QStringLiteral("TabButton.qml")), uri, 1, 0, "TabButton");
qmlRegisterType(componentUrl(QStringLiteral("ActionGroup.qml")), uri, 1, 0, "ActionGroup");
qmlRegisterType(componentUrl(QStringLiteral("ActionSideBar.qml")), uri, 1, 0, "ActionSideBar");
qmlRegisterType(componentUrl(QStringLiteral("ToolActions.qml")), uri, 1, 0, "ToolActions");
qmlRegisterType(componentUrl(QStringLiteral("ToolActions.qml")), uri, 1, 0, "ToolActions");
qmlRegisterType(componentUrl(QStringLiteral("ToolButtonMenu.qml")), uri, 1, 0, "ToolButtonMenu");
qmlRegisterType(componentUrl(QStringLiteral("ListItemTemplate.qml")), uri, 1, 0, "ListItemTemplate");
qmlRegisterType(componentUrl(QStringLiteral("FloatingButton.qml")), uri, 1, 0, "FloatingButton");
qmlRegisterType(componentUrl(QStringLiteral("ListItemTemplate.qml")), uri, 1, 0, "ListItemTemplate");
qmlRegisterType(componentUrl(QStringLiteral("FloatingButton.qml")), uri, 1, 0, "FloatingButton");
qmlRegisterType(componentUrl(QStringLiteral("PathBar.qml")), uri, 1, 0, "PathBar");
qmlRegisterType<PathList>(uri, 1, 0, "PathList");
/** 1.1 **/
/** 1.1 **/
qmlRegisterType(componentUrl(QStringLiteral("labs/SelectionBar.qml")), uri, 1, 1, "SelectionBar");
......@@ -142,7 +143,7 @@ void MauiKit::registerTypes(const char *uri)
qmlRegisterType<PlacesList>(uri, 1, 0, "PlacesList");
qmlRegisterType<FMList>(uri, 1, 0, "FMList");
qmlRegisterSingletonType<FMStatic>(uri, 1, 0, "FM",
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
return new FMStatic;
......@@ -154,18 +155,18 @@ void MauiKit::registerTypes(const char *uri)
qmlRegisterType(componentUrl(QStringLiteral("FilePreviewer.qml")), uri, 1, 0, "FilePreviewer");
qmlRegisterType(componentUrl(QStringLiteral("FileDialog.qml")), uri, 1, 0, "FileDialog");
#endif
#ifdef COMPONENT_EDITOR
/** EDITOR CONTROLS **/
qmlRegisterType<DocumentHandler>(uri, 1, 0, "DocumentHandler");
qmlRegisterType<SyntaxHighlighterUtil>();
qmlRegisterType(componentUrl(QStringLiteral("Editor.qml")), uri, 1, 0, "Editor");
qmlRegisterType(componentUrl(QStringLiteral("private/DocumentPreview.qml")), uri, 1, 0, "DocumentPreview");
qmlRegisterType(componentUrl(QStringLiteral("private/DocumentPreview.qml")), uri, 1, 0, "DocumentPreview");
#ifdef STATIC_MAUIKIT
qmlRegisterType<KQuickSyntaxHighlighter>("org.kde.kquicksyntaxhighlighter", 0, 1, "KQuickSyntaxHighlighter");
#endif
#endif
/** PLATFORMS SPECIFIC CONTROLS **/
......@@ -176,7 +177,7 @@ void MauiKit::registerTypes(const char *uri)
Q_UNUSED(scriptEngine)
return new MAUIAndroid;
});
#else
#elif defined Q_OS_LINUX
qmlRegisterType(componentUrl(QStringLiteral("Terminal.qml")), uri, 1, 0, "Terminal");
qmlRegisterSingletonType<MAUIKDE>(uri, 1, 0, "KDE",
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
......@@ -184,6 +185,8 @@ void MauiKit::registerTypes(const char *uri)
Q_UNUSED(scriptEngine)
return new MAUIKDE;
});
#elif defined Q_OS_WIN32
//here window platform integration interfaces
#endif
/** DATA MODELING TEMPLATED INTERFACES **/
......@@ -215,7 +218,7 @@ void MauiKit::registerTypes(const char *uri)
return new Handy;
});
#if defined Q_OS_ANDROID || defined APPIMAGE_PACKAGE || defined MAUIKIT_STYLE
#if defined MAUIKIT_STYLE
this->initResources();
#endif
......@@ -234,4 +237,4 @@ void MauiKit::initResources()
#endif
}
#include "moc_mauikit.cpp"
//#include "moc_mauikit.cpp"
......@@ -32,9 +32,9 @@
class MauiAccounts;
#ifdef STATIC_MAUIKIT
class MauiKit : public QQmlExtensionPlugin
#else
#else
class MAUIKIT_EXPORT MauiKit : public QQmlExtensionPlugin
#endif
#endif
{
Q_OBJECT
......@@ -55,10 +55,9 @@ public:
{
static MauiKit instance;
instance.registerTypes("org.kde.mauikit");
}
}
void initResources();
private:
QUrl componentUrl(const QString &fileName) const;
......
#include "accountsdb.h"
#include "utils.h"
#include <QUuid>
......@@ -23,7 +22,7 @@ AccountsDB::AccountsDB(QObject *parent) : QObject(parent)
collectionDBPath_dir.mkpath(".");
this->name = QUuid::createUuid().toString();
if(!UTIL::fileExists(FMPath + DBName))
if(!FMH::fileExists(FMPath + DBName))
{
this->openDB(this->name);
this->prepareCollectionDB();
......
QT *= core qml quick gui
exists($$PWD/KSyntaxHighlighting) {
message("Using KSyntaxHighlighting for Android")
android {
exists($$PWD/KSyntaxHighlighting) {
message("Using KSyntaxHighlighting for Android")
}else {
warning("Getting KSyntaxHighlighting for Android")
system(git clone $$KSYNTAXHIGHLIGHTING_REPO $$PWD/KSyntaxHighlighting)
}
ANDROID_EXTRA_LIBS += $$PWD/KSyntaxHighlighting/libKF5SyntaxHighlighting.so
}else:win32 {
}else {
warning("Getting KSyntaxHighlighting for Android")
system(git clone $$KSYNTAXHIGHLIGHTING_REPO $$PWD/KSyntaxHighlighting)
}
exists($$PWD/kquicksyntaxhighlighter) {
......@@ -22,7 +29,6 @@ HEADERS += \
SOURCES += \
$$PWD/kquicksyntaxhighlighter/kquicksyntaxhighlighter.cpp\
ANDROID_EXTRA_LIBS += $$PWD/KSyntaxHighlighting/libKF5SyntaxHighlighting.so
LIBS += -L$$PWD/KSyntaxHighlighting/ -lKF5SyntaxHighlighting
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
#if defined(Q_OS_ANDROID)
#include "mauiandroid.h"
#else
#elif defined Q_OS_LINUX
#include "mauikde.h"
#include <KFilePlacesModel>
#include <KIO/CopyJob>
......@@ -115,7 +115,7 @@ bool FMStatic::isDefaultPath(const QString &path)
QUrl FMStatic::parentDir(const QUrl &path)
{
return FMH::parentDir(path);
return FMH::parentDir(path);
}
bool FMStatic::isDir(const QUrl &path)
......@@ -178,17 +178,17 @@ QString FMStatic::formatDate(const QString &dateStr, const QString &format, cons
QString FMStatic::formatTime(const qint64 &value)
{
QString tStr;
if (value)
{
QTime time((value/3600)%60, (value/60)%60, value%60, (value*1000)%1000);
QString format = "mm:ss";
if (value > 3600)
format = "hh:mm:ss";
tStr = time.toString(format);
}
return tStr.isEmpty() ? "00:00" : tStr;
QString tStr;
if (value)
{
QTime time((value/3600)%60, (value/60)%60, value%60, (value*1000)%1000);
QString format = "mm:ss";
if (value > 3600)
format = "hh:mm:ss";
tStr = time.toString(format);
}
return tStr.isEmpty() ? "00:00" : tStr;
}
QString FMStatic::homePath()
......@@ -198,7 +198,7 @@ QString FMStatic::homePath()
bool FMStatic::copy(const QUrl &url, const QUrl &destinationDir, const bool &overWriteDirectory)
{
#ifdef Q_OS_ANDROID
#if defined Q_OS_ANDROID || defined Q_OS_WIN32
QFileInfo fileInfo(url.toLocalFile());
if(fileInfo.isFile())
QFile::copy(url.toLocalFile(), destinationDir.toLocalFile());
......@@ -246,30 +246,30 @@ bool FMStatic::copy(const QUrl &url, const QUrl &destinationDir, const bool &ove
bool FMStatic::cut(const QUrl &url, const QUrl &where)
{
return FMStatic::cut(url, where, QString());
return FMStatic::cut(url, where, QString());
}
bool FMStatic::cut(const QUrl &url, const QUrl &where, const QString &name)
{
QUrl _where;
if(name.isEmpty())
_where = QUrl(where.toString()+"/"+FMH::getFileInfoModel(url)[FMH::MODEL_KEY::LABEL]);
else
_where = QUrl(where.toString()+"/"+name);
#ifdef Q_OS_ANDROID
QFile file(url.toLocalFile());
file.rename(_where.toLocalFile());
#else
auto job = KIO::move(url, _where);
job->start();
#endif
#ifdef COMPONENT_TAGGING
Tagging::getInstance()->updateUrl(url.toString(), _where.toString());
#endif
return true;
QUrl _where;
if(name.isEmpty())
_where = QUrl(where.toString()+"/"+FMH::getFileInfoModel(url)[FMH::MODEL_KEY::LABEL]);
else
_where = QUrl(where.toString()+"/"+name);
#if defined Q_OS_ANDROID || defined Q_OS_WIN32
QFile file(url.toLocalFile());
file.rename(_where.toLocalFile());
#else
auto job = KIO::move(url, _where);
job->start();
#endif
#ifdef COMPONENT_TAGGING
Tagging::getInstance()->updateUrl(url.toString(), _where.toString());
#endif
return true;
}
bool FMStatic::removeFile(const QUrl &path)
......@@ -279,7 +279,7 @@ bool FMStatic::removeFile(const QUrl &path)
qDebug()<< "TRYING TO REMOVE FILE: " << path;
#ifdef Q_OS_ANDROID
#if defined Q_OS_ANDROID || defined Q_OS_WIN32
if(QFileInfo(path.toLocalFile()).isDir())
return FMStatic::removeDir(path);
else return QFile(path.toLocalFile()).remove();
......@@ -295,8 +295,7 @@ void FMStatic::moveToTrash(const QUrl &path)
if(!path.isLocalFile())
qWarning() << "URL recived is not a local file, FM::moveToTrash" << path;
#ifdef Q_OS_ANDROID
#else
#if defined Q_OS_LINUX && !defined Q_OS_ANDROID
auto job = KIO::trash(path);
job->start();
#endif
......@@ -304,8 +303,7 @@ void FMStatic::moveToTrash(const QUrl &path)
void FMStatic::emptyTrash()
{
#ifdef Q_OS_ANDROID
#else
#if defined Q_OS_LINUX && !defined Q_OS_ANDROID
auto job = KIO::emptyTrash();
job->start();
#endif
......@@ -342,12 +340,12 @@ bool FMStatic::removeDir(const QUrl &path)
bool FMStatic::rename(const QUrl &url, const QString &name)
{
return FMStatic::cut(url, QUrl(url.toString().left(url.toString().lastIndexOf("/"))), name);
return FMStatic::cut(url, QUrl(url.toString().left(url.toString().lastIndexOf("/"))), name);
}
bool FMStatic::createDir(const QUrl &path, const QString &name)
{
#ifdef Q_OS_ANDROID
#if defined Q_OS_ANDROID || defined Q_OS_WIN32
QFileInfo dd(path.toLocalFile());
return QDir(path.toLocalFile()).mkdir(name);
#else
......@@ -373,7 +371,7 @@ bool FMStatic::createFile(const QUrl &path, const QString &name)
bool FMStatic::createSymlink(const QUrl &path, const QUrl &where)
{
#ifdef Q_OS_ANDROID
#if defined Q_OS_ANDROID || defined Q_OS_WIN32
return QFile::link(path.toLocalFile(), where.toLocalFile() + "/" + QFileInfo(path.toLocalFile()).fileName());
#else
const auto job = KIO::link({path}, where);
......@@ -387,9 +385,11 @@ bool FMStatic::openUrl(const QUrl &url)
#ifdef Q_OS_ANDROID
MAUIAndroid::openUrl(url.toString());
return true;
#else
#elif defined Q_OS_LINUX
// return QDesktopServices::openUrl(QUrl::fromUserInput(url));
return KRun::runUrl(url, FMH::getFileInfoModel(url)[FMH::MODEL_KEY::MIME], nullptr, false, KRun::RunFlag::DeleteTemporaryFiles);
#elif defined Q_OS_WIN32
return QDesktopServices::openUrl(url);
#endif
}
......@@ -411,6 +411,6 @@ void FMStatic::setDirConf(const QUrl &path, const QString &group, const QString
bool FMStatic::checkFileType(const int& type, const QString& mimeTypeName)
{
return FMH::SUPPORTED_MIMETYPES[static_cast<FMH::FILTER_TYPE>(type)].contains(mimeTypeName);
return FMH::SUPPORTED_MIMETYPES[static_cast<FMH::FILTER_TYPE>(type)].contains(mimeTypeName);
}
......@@ -45,61 +45,61 @@ static struct
QVariantMap Handy::appInfo()
{
auto app = UTIL::app;
const auto app = UTIL::app;
auto res = QVariantMap({{FMH::MODEL_NAME[FMH::MODEL_KEY::NAME], app->applicationName()},
{FMH::MODEL_NAME[FMH::MODEL_KEY::VERSION], app->applicationVersion()},
{FMH::MODEL_NAME[FMH::MODEL_KEY::ORG], app->organizationName()},
{FMH::MODEL_NAME[FMH::MODEL_KEY::DOMAIN], app->organizationDomain()},
{FMH::MODEL_NAME[FMH::MODEL_KEY::DOMAIN_M], app->organizationDomain()},
{"mauikit_version", MAUIKIT_VERSION_STR},
{"qt_version", QT_VERSION_STR} });
#ifdef Q_OS_ANDROID
#ifdef Q_OS_ANDROID