Changeset View
Changeset View
Standalone View
Standalone View
krusader/Dialogs/popularurls.cpp
Show All 31 Lines | |||||
32 | #include <QHeaderView> | 32 | #include <QHeaderView> | ||
33 | #include <QLayout> | 33 | #include <QLayout> | ||
34 | #include <QLabel> | 34 | #include <QLabel> | ||
35 | #include <QToolButton> | 35 | #include <QToolButton> | ||
36 | 36 | | |||
37 | #include <KConfigCore/KSharedConfig> | 37 | #include <KConfigCore/KSharedConfig> | ||
38 | #include <KI18n/KLocalizedString> | 38 | #include <KI18n/KLocalizedString> | ||
39 | #include <KWidgetsAddons/KMessageBox> | 39 | #include <KWidgetsAddons/KMessageBox> | ||
40 | #include <KIconThemes/KIconLoader> | | |||
41 | #include <KItemViews/KTreeWidgetSearchLine> | 40 | #include <KItemViews/KTreeWidgetSearchLine> | ||
42 | 41 | | |||
43 | #include "../krglobal.h" | 42 | #include "../krglobal.h" | ||
43 | #include "../icon.h" | ||||
44 | #include "../krslots.h" | 44 | #include "../krslots.h" | ||
45 | #include "../GUI/krtreewidget.h" | 45 | #include "../GUI/krtreewidget.h" | ||
46 | 46 | | |||
47 | #define STARTING_RANK 20 | 47 | #define STARTING_RANK 20 | ||
48 | #define INCREASE 2 | 48 | #define INCREASE 2 | ||
49 | #define DECREASE 1 | 49 | #define DECREASE 1 | ||
50 | 50 | | |||
51 | PopularUrls::PopularUrls(QObject *parent) : QObject(parent), | 51 | PopularUrls::PopularUrls(QObject *parent) : QObject(parent), | ||
▲ Show 20 Lines • Show All 304 Lines • ▼ Show 20 Line(s) | 353 | { | |||
356 | QList<QUrl>::Iterator it; | 356 | QList<QUrl>::Iterator it; | ||
357 | 357 | | |||
358 | QTreeWidgetItem * lastItem = 0; | 358 | QTreeWidgetItem * lastItem = 0; | ||
359 | 359 | | |||
360 | for (it = list.begin(); it != list.end(); ++it) { | 360 | for (it = list.begin(); it != list.end(); ++it) { | ||
361 | QTreeWidgetItem *item = new QTreeWidgetItem(urls, lastItem); | 361 | QTreeWidgetItem *item = new QTreeWidgetItem(urls, lastItem); | ||
362 | lastItem = item; | 362 | lastItem = item; | ||
363 | item->setText(0, (*it).isLocalFile() ? (*it).path() : (*it).toDisplayString()); | 363 | item->setText(0, (*it).isLocalFile() ? (*it).path() : (*it).toDisplayString()); | ||
364 | item->setIcon(0, (*it).isLocalFile() ? SmallIcon("folder") : SmallIcon("folder-html")); | 364 | item->setIcon(0, (*it).isLocalFile() ? Icon("folder") : Icon("folder-html")); | ||
365 | } | 365 | } | ||
366 | 366 | | |||
367 | setMinimumSize(urls->sizeHint().width() + 45, 400); | 367 | setMinimumSize(urls->sizeHint().width() + 45, 400); | ||
368 | 368 | | |||
369 | search->clear(); | 369 | search->clear(); | ||
370 | search->setFocus(); | 370 | search->setFocus(); | ||
371 | selection = -1; | 371 | selection = -1; | ||
372 | slotVisibilityChanged(); | 372 | slotVisibilityChanged(); | ||
373 | exec(); | 373 | exec(); | ||
374 | } | 374 | } | ||
375 | 375 | |