X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=src%2Fvymmodel.cpp;fp=src%2Fvymmodel.cpp;h=f1378219f6b909e45e5c5c9564246c3763e3b4c2;hb=ab564585e1096b76cb929d7acc32cba6367669e4;hp=d3ce38483e9a1943381cdeb552e06cb486793094;hpb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;p=sven%2Fvym.git diff --git a/src/vymmodel.cpp b/src/vymmodel.cpp index d3ce384..f137821 100644 --- a/src/vymmodel.cpp +++ b/src/vymmodel.cpp @@ -1135,6 +1135,8 @@ bool VymModel::renameMap(const QString &newPath) qWarning() << "VymModel::renameMap failed to release lock for " << oldPath; vymLock = newLock; setFilePath(newPath); + if (readonly) + setReadOnly(false); return true; } qWarning() << "VymModel::renameMap failed to get lockfile. state=" << vymLock.getState(); @@ -1196,13 +1198,14 @@ void VymModel::fileChanged() { // Check if file on disk has changed meanwhile if (!filePath.isEmpty()) { - if (readonly) { + if (readonly && vymLock.getState() != VymLock::LockedByMyself) { // unset readonly if lockfile is gone + // but only, if map was LockedByOther before if (vymLock.tryLock()) setReadOnly(false); } else { - // We could check, if somebody else removed/replaced lockfile + // FIXME-5 We could check, if somebody else removed/replaced lockfile // (A unique vym ID would be needed) QDateTime tmod = QFileInfo(filePath).lastModified(); @@ -4843,6 +4846,21 @@ bool VymModel::exportLastAvailable(QString &description, QString &command, return false; } +void VymModel::setExportLastCommand(const QString &cmd) +{ + settings.setLocalValue(filePath, "/export/last/command", cmd); +} + +void VymModel::setExportLastDescription(const QString &desc) +{ + settings.setLocalValue(filePath, "/export/last/description", desc); +} + +void VymModel::setExportLastDestination(const QString &displayedDest) +{ + settings.setLocalValue(filePath, "/export/last/displayedDestination", displayedDest); +} + void VymModel::exportLast() { QString desc, command,