fixed bookmar-load error; clear pin; refs #131, #137

master
Marc Wäckerlin 13 years ago
parent 56e911c46f
commit 57643af2cc
  1. 13
      src/browser.hxx
  2. 1
      src/pinentry.hxx

@ -224,8 +224,9 @@ class Browser: public QMainWindow, protected Ui::Browser {
actionEditBookmarks->setVisible(false);
delete _bookmarks; _bookmarks=0;
}
if (!_kiosk && !_startUrl && _settings.flag("SaveWindowState")
&& _settings())
if (!_kiosk &&
((!_startUrl && _settings.flag("SaveWindowState") && _settings()) ||
_bookmarkfile.readable()))
loadWin();
if (urls.size()) load(urls.at(0));
for (int i(1); i<urls.size(); ++i) load(urls.at(i), newTab());
@ -269,8 +270,9 @@ class Browser: public QMainWindow, protected Ui::Browser {
void closeEvent(QCloseEvent *event) {
LOG;
if (!_kiosk && !_startUrl && _settings.flag("SaveWindowState")
&& _settings())
if (!_kiosk &&
((!_startUrl && _settings.flag("SaveWindowState") && _settings()) ||
_bookmarkfile.writeable()))
saveWin();
QMainWindow::closeEvent(event);
QApplication::exit(0);
@ -863,8 +865,8 @@ class Browser: public QMainWindow, protected Ui::Browser {
void saveWin() {
LOG<<"Save Window State";
if (!_settings()) return;
saveBookmarks();
if (!_settings()) return;
QStringList tabs;
for (int i(0); i<_tabs->count(); ++i)
tabs<<qobject_cast<QWebView*>(_tabs->widget(i))->url().toString();
@ -892,6 +894,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
void loadWin() {
LOG;
loadBookmarks();
if (!_settings()) return;
QStringList tabs(_settings()->value("Window/Tabs").toStringList());
int oldCnt(_tabs->count());
for (QStringList::iterator it(tabs.begin()); it!=tabs.end(); ++it) {

@ -50,6 +50,7 @@ class PinEntry: public QDialog, public Ui::PinEntry {
}
int myexec() {
LOG;
_pin->clear();
show();
LOG<<"SSSSSSSSSTTTTTTTAAAAAAAAAAAAARRRRRRRRRRTTTTTTTTTT";
int res(_run.exec(QEventLoop::ExcludeSocketNotifiers));

Loading…
Cancel
Save