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

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

Loading…
Cancel
Save