Commit f5c5ef8e authored by Aurélien Gâteau's avatar Aurélien Gâteau
Browse files

Url bag => Recent URLs

svn path=/trunk/KDE/kdegraphics/gwenview/; revision=958363
parent 5b887513
......@@ -57,7 +57,7 @@ struct GvCorePrivate {
QWidget* mParent;
SortedDirModel* mDirModel;
HistoryModel* mRecentFoldersModel;
HistoryModel* mUrlBagModel;
HistoryModel* mRecentUrlsModel;
bool showSaveAsDialog(const KUrl& url, KUrl* outUrl, QByteArray* format) {
KFileDialog dialog(url, QString(), mParent);
......@@ -109,7 +109,7 @@ GvCore::GvCore(QWidget* parent, SortedDirModel* dirModel)
d->mParent = parent;
d->mDirModel = dirModel;
d->mRecentFoldersModel = 0;
d->mUrlBagModel = 0;
d->mRecentUrlsModel = 0;
}
......@@ -126,11 +126,11 @@ QAbstractItemModel* GvCore::recentFoldersModel() const {
}
QAbstractItemModel* GvCore::urlBagModel() const {
if (!d->mUrlBagModel) {
d->mUrlBagModel = new HistoryModel(const_cast<GvCore*>(this), KStandardDirs::locateLocal("appdata", "urlbag/"));
QAbstractItemModel* GvCore::recentUrlsModel() const {
if (!d->mRecentUrlsModel) {
d->mRecentUrlsModel = new HistoryModel(const_cast<GvCore*>(this), KStandardDirs::locateLocal("appdata", "recenturls/"));
}
return d->mUrlBagModel;
return d->mRecentUrlsModel;
}
......@@ -145,9 +145,9 @@ void GvCore::addUrlToRecentFolders(const KUrl& url) {
}
void GvCore::addUrlToUrlBag(const KUrl& url) {
urlBagModel();
d->mUrlBagModel->addUrl(url);
void GvCore::addUrlToRecentUrls(const KUrl& url) {
recentUrlsModel();
d->mRecentUrlsModel->addUrl(url);
}
......
......@@ -45,11 +45,11 @@ public:
~GvCore();
QAbstractItemModel* recentFoldersModel() const;
QAbstractItemModel* urlBagModel() const;
QAbstractItemModel* recentUrlsModel() const;
AbstractSemanticInfoBackEnd* semanticInfoBackEnd() const;
void addUrlToRecentFolders(const KUrl&);
void addUrlToUrlBag(const KUrl& url);
void addUrlToRecentUrls(const KUrl& url);
public Q_SLOTS:
void saveAll();
......
......@@ -724,7 +724,7 @@ void MainWindow::slotModifiedDocumentListChanged() {
void MainWindow::setInitialUrl(const KUrl& url) {
Q_ASSERT(url.isValid());
if (url.protocol() == "http" || url.protocol() == "https") {
d->mGvCore->addUrlToUrlBag(url);
d->mGvCore->addUrlToRecentUrls(url);
}
if (UrlUtils::urlIsDirectory(url)) {
d->mBrowseAction->trigger();
......
......@@ -138,11 +138,11 @@ StartPage::StartPage(QWidget* parent, GvCore* gvCore)
SLOT(showRecentFoldersViewContextMenu(const QPoint&)));
// Url bag view
d->mUrlBagView->setItemDelegate(new HistoryViewDelegate(d->mUrlBagView));
connect(d->mUrlBagView, SIGNAL(clicked(const QModelIndex&)),
d->mRecentUrlsView->setItemDelegate(new HistoryViewDelegate(d->mRecentUrlsView));
connect(d->mRecentUrlsView, SIGNAL(clicked(const QModelIndex&)),
SLOT(slotListViewClicked(const QModelIndex&)) );
connect(d->mUrlBagView, SIGNAL(customContextMenuRequested(const QPoint&)),
connect(d->mRecentUrlsView, SIGNAL(customContextMenuRequested(const QPoint&)),
SLOT(showRecentFoldersViewContextMenu(const QPoint&)));
d->setupSearchUi(gvCore->semanticInfoBackEnd());
......@@ -178,7 +178,7 @@ void StartPage::applyPalette(const QPalette& newPalette) {
initViewPalette(d->mBookmarksView, fgColor);
initViewPalette(d->mTagView, fgColor);
initViewPalette(d->mRecentFoldersView, fgColor);
initViewPalette(d->mUrlBagView, fgColor);
initViewPalette(d->mRecentUrlsView, fgColor);
QString css = QString::fromUtf8(
"font-weight: bold;"
......@@ -217,8 +217,8 @@ void StartPage::showEvent(QShowEvent* event) {
if (!d->mRecentFoldersView->model()) {
d->mRecentFoldersView->setModel(d->mGvCore->recentFoldersModel());
}
if (!d->mUrlBagView->model()) {
d->mUrlBagView->setModel(d->mGvCore->urlBagModel());
if (!d->mRecentUrlsView->model()) {
d->mRecentUrlsView->setModel(d->mGvCore->recentUrlsModel());
}
QFrame::showEvent(event);
}
......@@ -235,9 +235,9 @@ void StartPage::showRecentFoldersViewContextMenu(const QPoint& pos) {
// Create menu
QMenu menu(this);
bool fromUrlBag = view == d->mUrlBagView;
QAction* addToPlacesAction = fromUrlBag ? 0 : menu.addAction(KIcon("bookmark-new"), i18n("Add to Places"));
QAction* removeAction = menu.addAction(KIcon("edit-delete"), fromUrlBag ? i18n("Forget this Url") : i18n("Forget this Folder"));
bool fromRecentUrls = view == d->mRecentUrlsView;
QAction* addToPlacesAction = fromRecentUrls ? 0 : menu.addAction(KIcon("bookmark-new"), i18n("Add to Places"));
QAction* removeAction = menu.addAction(KIcon("edit-delete"), fromRecentUrls ? i18n("Forget this Url") : i18n("Forget this Folder"));
menu.addSeparator();
QAction* clearAction = menu.addAction(KIcon("edit-delete-all"), i18n("Forget All"));
......
......@@ -155,7 +155,7 @@
</sizepolicy>
</property>
<property name="text">
<string>URL Bag</string>
<string>Recent URLs</string>
</property>
<property name="title" stdset="0">
<bool>true</bool>
......@@ -195,7 +195,7 @@
</spacer>
</item>
<item row="1" column="2">
<widget class="QListView" name="mUrlBagView">
<widget class="QListView" name="mRecentUrlsView">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment