now again does not work anymore WHY??? + trace filename; refs #130

master
Marc Wäckerlin 13 years ago
parent b61222e7cd
commit e8741e9e0b
  1. 4
      src/browser.hxx
  2. 7
      src/main.cxx
  3. 5
      src/qbrowserlib/filestorage.hxx

@ -881,7 +881,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
urls.removeAll(""); urls.removeAll("");
urls.removeDuplicates(); urls.removeDuplicates();
if (_bookmarkfile.writeable()) { if (_bookmarkfile.writeable()) {
LOG<<"write to bookmark file"; LOG<<"write to bookmark file"<<_bookmarkfile.name();
_bookmarkfile.write(urls); _bookmarkfile.write(urls);
} else if (_settings()) { } else if (_settings()) {
LOG<<"write to settings"; LOG<<"write to settings";
@ -911,7 +911,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
TRC; LOG<<"Loading Bookmarks ..."; TRC; LOG<<"Loading Bookmarks ...";
QStringList urls; QStringList urls;
if (_bookmarkfile.readable()) { if (_bookmarkfile.readable()) {
LOG<<"load from file"; LOG<<"load from file"<<_bookmarkfile.name();
urls = _bookmarkfile.read(); urls = _bookmarkfile.read();
} else if (_settings()) { } else if (_settings()) {
LOG<<"load from settings"; LOG<<"load from settings";

@ -248,14 +248,15 @@ int main(int argv, char** argc) try {
<<"Hostname"<<QNetworkProxy::applicationProxy().hostName() <<"Hostname"<<QNetworkProxy::applicationProxy().hostName()
<<"Port"<<QNetworkProxy::applicationProxy().port(); <<"Port"<<QNetworkProxy::applicationProxy().port();
//............................................................................ //............................................................................
LOG<<"LIBRARY PATHES:\n"<<app.libraryPaths().join("\n").toStdString(); std::cout<<"LIBRARY PATHES:\n"<<app.libraryPaths().join("\n").toStdString()<<std::endl;
if (env().contains("QT_PLUGIN_PATH")) { if (env().contains("QT_PLUGIN_PATH")) {
foreach (QString path, env()["QT_PLUGIN_PATH"].split(":")) { foreach (QString path, env()["QT_PLUGIN_PATH"].split(":")) {
LOG<<"**** Setting: PLUGIN-PATH to "<<path.toStdString(); std::cout<<"**** Setting: PLUGIN-PATH to "<<path.toStdString()<<std::endl;
app.addLibraryPath(path); app.addLibraryPath(path);
} }
} else { } else {
LOG<<"**** PLUGIN-PATH is not defined"; std::cout<<"**** PLUGIN-PATH is not defined"<<std::endl;
abort();
} }
if (env().contains("QTWEBKIT_PLUGIN_PATH")) if (env().contains("QTWEBKIT_PLUGIN_PATH"))
qt_drt_overwritePluginDirectories(); qt_drt_overwritePluginDirectories();

@ -31,6 +31,8 @@ class Storage: public QObject {
operator bool() { operator bool() {
return valid(); return valid();
} }
/*! @return name of the storage, e.g. filename */
virtual QString name() = 0;
/*! @return true if storage object already exists */ /*! @return true if storage object already exists */
virtual bool readable() = 0; virtual bool readable() = 0;
/*! @return true if storage object exists or could be created */ /*! @return true if storage object exists or could be created */
@ -53,6 +55,9 @@ class FileStorage: public Storage {
assert(connect(&_watcher, SIGNAL(fileChanged(const QString&)), assert(connect(&_watcher, SIGNAL(fileChanged(const QString&)),
SIGNAL(changed()))); SIGNAL(changed())));
} }
QString name() {
return _file.fileName();
}
bool readable() { bool readable() {
return QFileInfo(_file).exists(); return QFileInfo(_file).exists();
} }

Loading…
Cancel
Save