aboutsummaryrefslogtreecommitdiff
path: root/notebookmodel.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-06-14 20:18:59 +0200
committerJavier <dev.git@javispedro.com>2015-06-14 20:18:59 +0200
commitfb55ea21c891a75f2e7e06d336faa9b5b8b105a3 (patch)
tree4c8d677ea98027576f44b8acfbc60b34675fe215 /notebookmodel.cc
parent3a17eeddaf005a5e9fe48f1207978d0a0da0ae9d (diff)
downloadscribiu-fb55ea21c891a75f2e7e06d336faa9b5b8b105a3.tar.gz
scribiu-fb55ea21c891a75f2e7e06d336faa9b5b8b105a3.zip
improve sync locking and status messages
Diffstat (limited to 'notebookmodel.cc')
-rw-r--r--notebookmodel.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/notebookmodel.cc b/notebookmodel.cc
index dc72931..e52d3f4 100644
--- a/notebookmodel.cc
+++ b/notebookmodel.cc
@@ -139,8 +139,14 @@ QVariant NotebookModel::data(const QModelIndex &index, int role) const
case 1:
return QVariant();
case 2:
- if (isNotebookLocked(penName, notebookName)) {
- return QApplication::style()->standardIcon(QStyle::SP_BrowserReload);
+ if (notebookName != PAPER_REPLAY) {
+ if (isNotebookLocked(penName, notebookName)) {
+ return QApplication::style()->standardIcon(QStyle::SP_BrowserReload);
+ }
+ } else {
+ if (isPaperReplayLocked(penName)) {
+ return QApplication::style()->standardIcon(QStyle::SP_BrowserReload);
+ }
}
break;
}
@@ -385,7 +391,17 @@ bool NotebookModel::isNotebookLocked(const QString &pen, const QString &notebook
{
QDir dir = notebookDir(pen, notebook);
if (dir.exists(".sync.lck")) {
- return true; // TODO check if stale
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool NotebookModel::isPaperReplayLocked(const QString &pen) const
+{
+ QDir dir(paperReplayDirectory(pen));
+ if (dir.exists(".sync.lck")) {
+ return true;
} else {
return false;
}