[companion] Default sdcard sync local folder to current profile (#1241)

Set the local folder to match that set in the profiles "SD structure path" setting
This commit is contained in:
Neil Horne
2021-12-12 19:33:57 +11:00
committed by GitHub
parent af87e2e365
commit 49fe09bc58
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -847,6 +847,13 @@ void MainWindow::sdsync()
static bool showExtraOptions = false;
QStringList errorMsgs;
if (syncOpts.sessionId != g.sessionId()) {
syncOpts.reset();
syncOpts.folderA = QString();
syncOpts.folderB = QString();
syncOpts.sessionId = g.sessionId();
}
if (syncOpts.folderA.isEmpty())
syncOpts.folderA = g.profile[g.id()].sdPath();
if (syncOpts.folderB.isEmpty())
+2
View File
@@ -75,6 +75,7 @@ class SyncProcess : public QObject
int flags; // SyncOptionFlags
int dirFilterFlags; // QDir::Filters
int logLevel; // QtMsgType (see ProgressWidget::addMessage())
int sessionId; // Last run radio profile
void reset()
{
@@ -86,6 +87,7 @@ class SyncProcess : public QObject
logLevel = QtWarningMsg;
flags = OPT_RECURSIVE;
dirFilterFlags = QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot;
sessionId = -1;
}
friend inline QDebug operator<<(QDebug debug, const SyncOptions &o) {