~ubuntu-branches/debian/stretch/qpdfview/stretch

« back to all changes in this revision

Viewing changes to sources/database.cpp

  • Committer: Package Import Robot
  • Author(s): Benjamin Eltzner
  • Date: 2015-03-22 11:42:36 UTC
  • mfrom: (1.2.16)
  • Revision ID: package-import@ubuntu.com-20150322114236-81p4twy532ytw10m
Tags: 0.4.14-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 
3
3
Copyright 2014 S. Razi Alavizadeh
4
 
Copyright 2012-2014 Adam Reichold
 
4
Copyright 2012-2015 Adam Reichold
5
5
Copyright 2012 Michał Trybus
6
6
 
7
7
This file is part of qpdfview.
141
141
    return instanceNames;
142
142
}
143
143
 
144
 
void Database::restoreTabs()
 
144
void Database::restoreTabs(const RestoreTab& restoreTab)
145
145
{
146
146
#ifdef WITH_SQL
147
147
 
164
164
                return;
165
165
            }
166
166
 
167
 
            emit tabRestored(query.value(0).toString(),
168
 
                             static_cast< bool >(query.value(2).toUInt()),
169
 
                             static_cast< LayoutMode >(query.value(3).toUInt()),
170
 
                             query.value(4).toBool(),
171
 
                             static_cast< ScaleMode >(query.value(5).toUInt()),
172
 
                             query.value(6).toReal(),
173
 
                             static_cast< Rotation >(query.value(7).toUInt()),
174
 
                             query.value(1).toInt());
 
167
            DocumentView* newTab = restoreTab(query.value(0).toString());
 
168
 
 
169
            if(newTab != 0)
 
170
            {
 
171
                newTab->setContinuousMode(query.value(2).toBool());
 
172
                newTab->setLayoutMode(static_cast< LayoutMode >(query.value(3).toUInt()));
 
173
                newTab->setRightToLeftMode(query.value(4).toBool());
 
174
 
 
175
                newTab->setScaleMode(static_cast< ScaleMode >(query.value(5).toUInt()));
 
176
                newTab->setScaleFactor(query.value(6).toReal());
 
177
 
 
178
                newTab->setRotation(static_cast< Rotation >(query.value(7).toUInt()));
 
179
 
 
180
                newTab->jumpToPage(query.value(1).toInt());
 
181
            }
175
182
        }
176
183
 
177
184
        transaction.commit();
212
219
            query.bindValue(1, instanceName());
213
220
            query.bindValue(2, tab->currentPage());
214
221
 
215
 
            query.bindValue(3, static_cast< uint >(tab->continuousMode()));
 
222
            query.bindValue(3, tab->continuousMode());
216
223
            query.bindValue(4, static_cast< uint >(tab->layoutMode()));
217
 
            query.bindValue(5, static_cast< uint >(tab->rightToLeftMode()));
 
224
            query.bindValue(5, tab->rightToLeftMode());
218
225
 
219
226
            query.bindValue(6, static_cast< uint >(tab->scaleMode()));
220
227
            query.bindValue(7, tab->scaleFactor());
367
374
        transaction.commit();
368
375
    }
369
376
 
370
 
#else
371
 
 
372
 
    Q_UNUSED(bookmarks);
373
 
 
374
377
#endif // WITH_SQL
375
378
}
376
379
 
462
465
        query.bindValue(1, QCryptographicHash::hash(tab->fileInfo().absoluteFilePath().toUtf8(), QCryptographicHash::Sha1).toBase64());
463
466
        query.bindValue(2, tab->currentPage());
464
467
 
465
 
        query.bindValue(3, static_cast< uint >(tab->continuousMode()));
 
468
        query.bindValue(3, tab->continuousMode());
466
469
        query.bindValue(4, static_cast< uint >(tab->layoutMode()));
467
 
        query.bindValue(5, static_cast< uint >(tab->rightToLeftMode()));
 
470
        query.bindValue(5, tab->rightToLeftMode());
468
471
 
469
472
        query.bindValue(6, static_cast< uint >(tab->scaleMode()));
470
473
        query.bindValue(7, tab->scaleFactor());