diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 60d79780d..3741e5474 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -3,6 +3,7 @@ set(lattedock-app_SRCS infoview.cpp lattecorona.cpp screenpool.cpp + types.cpp main.cpp ) diff --git a/app/indicator/factory.cpp b/app/indicator/factory.cpp index 7616b680d..e43f70357 100644 --- a/app/indicator/factory.cpp +++ b/app/indicator/factory.cpp @@ -251,7 +251,7 @@ QString Factory::uiPath(QString pluginName) const return m_pluginUiPaths[pluginName]; } -Latte::Types::ImportExportState Factory::importIndicatorFile(QString compressedFile) +Latte::ImportExport::State Factory::importIndicatorFile(QString compressedFile) { auto showNotificationError = []() { auto notification = new KNotification("import-fail", KNotification::CloseOnTimeout); @@ -281,7 +281,7 @@ Latte::Types::ImportExportState Factory::importIndicatorFile(QString compressedF if (!tarArchive->isOpen()) { delete tarArchive; showNotificationError(); - return Latte::Types::Failed; + return Latte::ImportExport::FailedState; } else { archive = tarArchive; } @@ -329,11 +329,11 @@ Latte::Types::ImportExportState Factory::importIndicatorFile(QString compressedF QString output(process.readAllStandardOutput()); showNotificationSucceed(metadata.name(), updated); - return Latte::Types::Installed; + return Latte::ImportExport::InstalledState; } showNotificationError(); - return Latte::Types::Failed; + return Latte::ImportExport::FailedState; } void Factory::removeIndicator(QString id) diff --git a/app/indicator/factory.h b/app/indicator/factory.h index f119c3d38..d20ac37c9 100644 --- a/app/indicator/factory.h +++ b/app/indicator/factory.h @@ -20,14 +20,14 @@ #ifndef INDICATORFACTORY_H #define INDICATORFACTORY_H +// local +#include "../types.h" + // Qt #include #include #include -// Latte -#include - class KPluginMetaData; namespace Latte { @@ -62,7 +62,7 @@ public: static bool metadataAreValid(QString &file); //! imports an indicator compressed file - static Latte::Types::ImportExportState importIndicatorFile(QString compressedFile); + static Latte::ImportExport::State importIndicatorFile(QString compressedFile); signals: void indicatorChanged(const QString &indicatorId); void indicatorRemoved(const QString &indicatorId); diff --git a/app/types.cpp b/app/types.cpp new file mode 100644 index 000000000..36496aff8 --- /dev/null +++ b/app/types.cpp @@ -0,0 +1,21 @@ +/* +* Copyright 2020 Michail Vourlakos +* +* +* This file is part of Latte-Dock +* +* Latte-Dock is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* Latte-Dock is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#include "types.h" diff --git a/app/types.h b/app/types.h new file mode 100644 index 000000000..dea6ea810 --- /dev/null +++ b/app/types.h @@ -0,0 +1,42 @@ +/* +* Copyright 2020 Michail Vourlakos +* +* +* This file is part of Latte-Dock +* +* Latte-Dock is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* Latte-Dock is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#ifndef LATTEAPPLOCALTYPES_H +#define LATTEAPPLOCALTYPES_H + +// Qt +#include + +namespace Latte { +namespace ImportExport { +Q_NAMESPACE + +enum State +{ + FailedState = 0, + UpdatedState = 2, + InstalledState = 4 +}; +Q_ENUM_NS(State); + +} +} + +#endif