first problem resolved: url bar is no more red if bookmarkfile is empty, and empty or duplicate bookmarks are removed from the list; refs #147
This commit is contained in:
@@ -878,6 +878,8 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
|||||||
if (qobject_cast<QComboBox*>(_url))
|
if (qobject_cast<QComboBox*>(_url))
|
||||||
for (int i(0); i<qobject_cast<QComboBox*>(_url)->count(); ++i)
|
for (int i(0); i<qobject_cast<QComboBox*>(_url)->count(); ++i)
|
||||||
urls<<qobject_cast<QComboBox*>(_url)->itemText(i);
|
urls<<qobject_cast<QComboBox*>(_url)->itemText(i);
|
||||||
|
urls.removeAll("");
|
||||||
|
urls.removeDuplicates();
|
||||||
if (_bookmarkfile.writeable()) {
|
if (_bookmarkfile.writeable()) {
|
||||||
LOG<<"write to bookmark file";
|
LOG<<"write to bookmark file";
|
||||||
_bookmarkfile.write(urls);
|
_bookmarkfile.write(urls);
|
||||||
@@ -915,6 +917,8 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
|||||||
LOG<<"load from settings";
|
LOG<<"load from settings";
|
||||||
urls = _settings()->value("Window/Urls").toStringList();
|
urls = _settings()->value("Window/Urls").toStringList();
|
||||||
}
|
}
|
||||||
|
urls.removeAll("");
|
||||||
|
urls.removeDuplicates();
|
||||||
if (qobject_cast<QComboBox*>(_url)) {
|
if (qobject_cast<QComboBox*>(_url)) {
|
||||||
QString ci(qobject_cast<QComboBox*>(_url)->currentText());
|
QString ci(qobject_cast<QComboBox*>(_url)->currentText());
|
||||||
qobject_cast<QComboBox*>(_url)->clear();
|
qobject_cast<QComboBox*>(_url)->clear();
|
||||||
|
Reference in New Issue
Block a user