summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2008-12-06 23:30:36 +0100
committerAndrea Diamantini <adjam7@gmail.com>2008-12-06 23:30:36 +0100
commita02a9101fe127211de1fd24f6876b87686309997 (patch)
tree5ce7921378ef55ac963f2946f6c00f85d0ab7445
parentctrl + tab switching: try 5.. (diff)
downloadrekonq-a02a9101fe127211de1fd24f6876b87686309997.tar.xz
QTabWidget --> KTabWidget
-rw-r--r--src/autosaver.cpp9
-rw-r--r--src/autosaver.h8
-rw-r--r--src/tabwidget.cpp28
-rw-r--r--src/tabwidget.h10
4 files changed, 34 insertions, 21 deletions
diff --git a/src/autosaver.cpp b/src/autosaver.cpp
index 4b83b65d..c1164e60 100644
--- a/src/autosaver.cpp
+++ b/src/autosaver.cpp
@@ -20,25 +20,26 @@
#include "autosaver.h"
-#include <QtCore/QDir>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QMetaObject>
+#include <QtCore>
#include <QtDebug>
#define AUTOSAVE_IN 1000 * 3 // seconds
#define MAXWAIT 1000 * 15 // seconds
+
AutoSaver::AutoSaver(QObject *parent) : QObject(parent)
{
Q_ASSERT(parent);
}
+
AutoSaver::~AutoSaver()
{
if (m_timer.isActive())
qWarning() << "AutoSaver: still active when destroyed, changes not saved.";
}
+
void AutoSaver::changeOccurred()
{
if (m_firstChange.isNull())
@@ -51,6 +52,7 @@ void AutoSaver::changeOccurred()
}
}
+
void AutoSaver::timerEvent(QTimerEvent *event)
{
if (event->timerId() == m_timer.timerId()) {
@@ -60,6 +62,7 @@ void AutoSaver::timerEvent(QTimerEvent *event)
}
}
+
void AutoSaver::saveIfNeccessary()
{
if (!m_timer.isActive())
diff --git a/src/autosaver.h b/src/autosaver.h
index d8004a9d..70dca53a 100644
--- a/src/autosaver.h
+++ b/src/autosaver.h
@@ -21,17 +21,15 @@
#ifndef AUTOSAVER_H
#define AUTOSAVER_H
-#include <QtCore/QObject>
-#include <QtCore/QBasicTimer>
-#include <QtCore/QTime>
+#include <QtCore>
/*
This class will call the save() slot on the parent object when the parent changes.
It will wait several seconds after changed() to combining multiple changes and
prevent continuous writing to disk.
*/
-class AutoSaver : public QObject {
-
+class AutoSaver : public QObject
+{
Q_OBJECT
public:
diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp
index 57e80856..b8e9c748 100644
--- a/src/tabwidget.cpp
+++ b/src/tabwidget.cpp
@@ -57,6 +57,11 @@ TabBar::TabBar(QWidget *parent)
}
+TabBar::~TabBar()
+{
+}
+
+
void TabBar::selectTabAction()
{
if (QShortcut *shortCut = qobject_cast<QShortcut*>(sender()))
@@ -199,7 +204,7 @@ void TabBar::reloadTab()
TabWidget::TabWidget(QWidget *parent)
- : QTabWidget(parent)
+ : KTabWidget(parent)
, m_recentlyClosedTabsAction(0)
, m_newTabAction(0)
, m_closeTabAction(0)
@@ -266,6 +271,11 @@ TabWidget::TabWidget(QWidget *parent)
}
+TabWidget::~TabWidget()
+{
+}
+
+
void TabWidget::clear()
{
// clear the recently closed tabs
@@ -310,7 +320,6 @@ void TabWidget::reloadTab(int index)
}
-
void TabWidget::addWebAction(KAction *action, QWebPage::WebAction webAction)
{
if (!action)
@@ -588,8 +597,10 @@ void TabWidget::closeTab(int index)
return;
bool hasFocus = false;
- if (WebView *tab = webView(index)) {
- if (tab->isModified()) {
+ if (WebView *tab = webView(index))
+ {
+ if (tab->isModified())
+ {
QMessageBox closeConfirmation(tab);
closeConfirmation.setWindowFlags(Qt::Sheet);
closeConfirmation.setWindowTitle(i18n("Do you really want to close this page?"));
@@ -627,9 +638,10 @@ void TabWidget::webViewLoadStarted()
{
WebView *webView = qobject_cast<WebView*>(sender());
int index = webViewIndex(webView);
- if (-1 != index) {
- QIcon icon(QLatin1String(":loading.gif")); // FIXME
- setTabIcon(index, icon);
+ if (-1 != index)
+ {
+// QIcon icon(QLatin1String(":loading.gif"));
+ setTabIcon(index, KIcon("rekonq") );
}
}
@@ -694,7 +706,7 @@ void TabWidget::aboutToShowRecentTriggeredAction(QAction *action)
void TabWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
- if ( !childAt(event->pos())
+ if ( !childAt(event->pos() )
// Remove the line below when QTabWidget does not have a one pixel frame
&& event->pos().y() < (tabBar()->y() + tabBar()->height()))
{
diff --git a/src/tabwidget.h b/src/tabwidget.h
index 6e9f2f66..020376e1 100644
--- a/src/tabwidget.h
+++ b/src/tabwidget.h
@@ -45,6 +45,7 @@ signals:
public:
TabBar(QWidget *parent = 0);
+ ~TabBar();
protected:
void mousePressEvent(QMouseEvent* event);
@@ -72,7 +73,6 @@ private:
// ----------------------------------------------------------------------------------------------------------------------------
-
#include <QWebPage>
class WebView;
@@ -112,9 +112,7 @@ private:
#include <KUrl>
#include <KLineEdit>
#include <KMenu>
-
-// Qt Includes
-#include <QTabWidget>
+#include <KTabWidget>
QT_BEGIN_NAMESPACE
class QCompleter;
@@ -127,7 +125,7 @@ QT_END_NAMESPACE
Connects up the current tab's signals to this class's signal and uses WebActionMapper
to proxy the actions.
*/
-class TabWidget : public QTabWidget
+class TabWidget : public KTabWidget
{
Q_OBJECT
@@ -150,6 +148,8 @@ signals:
public:
TabWidget(QWidget *parent = 0);
+ ~TabWidget();
+
void clear();
void addWebAction(KAction *action, QWebPage::WebAction webAction);