[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:
@@ -847,6 +847,13 @@ void MainWindow::sdsync()
|
|||||||
static bool showExtraOptions = false;
|
static bool showExtraOptions = false;
|
||||||
QStringList errorMsgs;
|
QStringList errorMsgs;
|
||||||
|
|
||||||
|
if (syncOpts.sessionId != g.sessionId()) {
|
||||||
|
syncOpts.reset();
|
||||||
|
syncOpts.folderA = QString();
|
||||||
|
syncOpts.folderB = QString();
|
||||||
|
syncOpts.sessionId = g.sessionId();
|
||||||
|
}
|
||||||
|
|
||||||
if (syncOpts.folderA.isEmpty())
|
if (syncOpts.folderA.isEmpty())
|
||||||
syncOpts.folderA = g.profile[g.id()].sdPath();
|
syncOpts.folderA = g.profile[g.id()].sdPath();
|
||||||
if (syncOpts.folderB.isEmpty())
|
if (syncOpts.folderB.isEmpty())
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class SyncProcess : public QObject
|
|||||||
int flags; // SyncOptionFlags
|
int flags; // SyncOptionFlags
|
||||||
int dirFilterFlags; // QDir::Filters
|
int dirFilterFlags; // QDir::Filters
|
||||||
int logLevel; // QtMsgType (see ProgressWidget::addMessage())
|
int logLevel; // QtMsgType (see ProgressWidget::addMessage())
|
||||||
|
int sessionId; // Last run radio profile
|
||||||
|
|
||||||
void reset()
|
void reset()
|
||||||
{
|
{
|
||||||
@@ -86,6 +87,7 @@ class SyncProcess : public QObject
|
|||||||
logLevel = QtWarningMsg;
|
logLevel = QtWarningMsg;
|
||||||
flags = OPT_RECURSIVE;
|
flags = OPT_RECURSIVE;
|
||||||
dirFilterFlags = QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot;
|
dirFilterFlags = QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot;
|
||||||
|
sessionId = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
friend inline QDebug operator<<(QDebug debug, const SyncOptions &o) {
|
friend inline QDebug operator<<(QDebug debug, const SyncOptions &o) {
|
||||||
|
|||||||
Reference in New Issue
Block a user