summaryrefslogtreecommitdiff
path: root/src/organizercore.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-07-18 05:07:32 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2020-11-03 11:39:01 -0500
commitccab9eae8df3cf5367ce5cf164c98d1534ac13cb (patch)
tree603bddc6dc14d256d4b416514e089326be83c42e /src/organizercore.cpp
parent75cc2ffead148ab2409cd1ef469613d2e9b80e17 (diff)
add warning when profile given with -p doesn't exist
implemented moshortcut, nxm links and executable names as command line options
Diffstat (limited to 'src/organizercore.cpp')
-rw-r--r--src/organizercore.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 1c35720b..f9cafc95 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -38,6 +38,7 @@
#include "shared/directoryentry.h"
#include "shared/filesorigin.h"
#include "shared/fileentry.h"
+#include "shared/util.h"
#include <QApplication>
#include <QCoreApplication>
@@ -395,7 +396,9 @@ void OrganizerCore::profileRemoved(QString const& profileName)
void OrganizerCore::externalMessage(const QString &message)
{
- if (MOShortcut moshortcut{ message } ) {
+ MOShortcut moshortcut(message);
+
+ if (moshortcut.isValid()) {
if(moshortcut.hasExecutable()) {
processRunner()
.setFromShortcut(moshortcut)
@@ -555,12 +558,16 @@ void OrganizerCore::setCurrentProfile(const QString &profileName)
QString profileDir = profileBaseDir.absoluteFilePath(profileName);
if (!QDir(profileDir).exists()) {
+ log::error("profile '{}' does not exist", profileName);
+
// selected profile doesn't exist. Ensure there is at least one profile,
// then pick any one
createDefaultProfile();
profileDir = profileBaseDir.absoluteFilePath(
profileBaseDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot).at(0));
+
+ log::error("picked profile '{}' instead", QDir(profileDir).dirName());
}
// Keep the old profile to emit signal-changed: