summaryrefslogtreecommitdiff
path: root/src/previewimage.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-16 02:24:14 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-16 02:24:14 +0200
commitb86685795a003e22f3e5a5c6e01f928acb729090 (patch)
tree35c1c32cfbdd1b5eb32bf8c3d01b2c369fdbaf71 /src/previewimage.cpp
parentsome fixes on preview home page mechanism (diff)
downloadrekonq-b86685795a003e22f3e5a5c6e01f928acb729090.tar.xz
removed bugged closed tabs and implemented a simple tab switch
Diffstat (limited to 'src/previewimage.cpp')
-rw-r--r--src/previewimage.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/previewimage.cpp b/src/previewimage.cpp
index fd007432..5430c80b 100644
--- a/src/previewimage.cpp
+++ b/src/previewimage.cpp
@@ -32,6 +32,8 @@
#include "application.h"
#include "history.h"
#include "rekonq.h"
+#include "mainwindow.h"
+#include "mainview.h"
// KDE Includes
#include <KUrl>
@@ -168,17 +170,26 @@ void PreviewImage::mouseMoveEvent(QMouseEvent *event)
void PreviewImage::mousePressEvent(QMouseEvent *event)
{
- switch(event->button())
+ if(event->button() == Qt::LeftButton)
{
- case Qt::LeftButton:
- Application::instance()->loadUrl(m_url);
- break;
- case Qt::RightButton:
- // TODO
- break;
- default:
- QLabel::mousePressEvent(event);
+ if(m_isFavorite)
+ {
+ Application::instance()->loadUrl(m_url);
+ }
+ else
+ {
+ MainView *mv = Application::instance()->mainWindow()->mainView();
+ int actualIndex = mv->currentIndex();
+
+ kDebug() << "Actual index: " << actualIndex;
+ kDebug() << "m_index: " << m_index;
+
+ mv->slotCloseTab(actualIndex);
+ mv->setCurrentIndex(m_index);
+ }
+ return;
};
+ QLabel::mousePressEvent(event);
}