summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 69831f97..cf8af892 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -451,7 +451,7 @@ void MainWindow::setupSidePanel()
void MainWindow::slotUpdateConfiguration()
{
// ============== General ==================
- mainView()->showTabBar();
+ mainView()->updateTabBar();
// =========== Fonts ==============
QWebSettings *defaultSettings = QWebSettings::globalSettings();
@@ -1088,18 +1088,33 @@ void MainWindow::slotOpenActionUrl(QAction *action)
void MainWindow::addFavoriteLink()
{
QString name = currentTab()->title();
- QString url = currentTab()->url().pathOrUrl();
+ QString url = currentTab()->url().prettyUrl(KUrl::RemoveTrailingSlash);
QStringList names = ReKonfig::previewNames();
QStringList urls = ReKonfig::previewUrls();
- names.prepend(name);
- if(names.count() > 8)
- names.removeLast();
- urls.prepend(url);
- if(urls.count() > 8)
- urls.removeLast();
+ for (int i = 0; i < 8 && i < urls.size() ; ++i)
+ {
+ if(urls.at(i).isEmpty() || urls.at(i) == url)
+ {
+ names.replace(i, name);
+ urls.replace(i, url);
+ break;
+ }
+ if(i == 7)
+ {
+ names.prepend(name);
+ if(names.count() > 8)
+ names.removeLast();
+
+ urls.prepend(url);
+ if(urls.count() > 8)
+ urls.removeLast();
+
+ break;
+ }
+ }
ReKonfig::setPreviewNames(names);
ReKonfig::setPreviewUrls(urls);