summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/notificationbar.cpp6
-rw-r--r--src/notificationbar.h3
-rw-r--r--src/previewselectorbar.h2
-rw-r--r--src/webtab.cpp25
4 files changed, 24 insertions, 12 deletions
diff --git a/src/notificationbar.cpp b/src/notificationbar.cpp
index 1ff29e92..94c5cba8 100644
--- a/src/notificationbar.cpp
+++ b/src/notificationbar.cpp
@@ -74,6 +74,12 @@ NotificationBar::NotificationBar(QWidget *parent)
setGraphicsEffect(m_blinkEffect);
}
+NotificationBar::~NotificationBar()
+{
+ delete m_opacityAnimation;
+ delete m_blinkEffect;
+}
+
void NotificationBar::notifyUser(int animationDuration)
{
m_opacityAnimation->setDuration(animationDuration);
diff --git a/src/notificationbar.h b/src/notificationbar.h
index 15b0255c..858fac80 100644
--- a/src/notificationbar.h
+++ b/src/notificationbar.h
@@ -37,8 +37,9 @@ class NotificationBar : public QWidget
{
public:
explicit NotificationBar(QWidget *parent = 0);
+ ~NotificationBar();
- void notifyUser(int animationDuration = 500);
+ void notifyUser(int animationDuration = 400);
private:
BlinkEffect *m_blinkEffect;
diff --git a/src/previewselectorbar.h b/src/previewselectorbar.h
index 214514db..9f8c78cc 100644
--- a/src/previewselectorbar.h
+++ b/src/previewselectorbar.h
@@ -45,6 +45,8 @@ public:
PreviewSelectorBar(int index, QWidget *parent);
~PreviewSelectorBar();
+ inline void setIndex(int index) { m_previewIndex = index; }
+
private slots:
void clicked();
diff --git a/src/webtab.cpp b/src/webtab.cpp
index 02c94d32..cce09953 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -129,19 +129,20 @@ void WebTab::createWalletBar(const QString &key, const QUrl &url)
if (blackList.contains(urlString))
return;
+ KWebWallet *wallet = page()->wallet();
if(_walletBar.isNull()) {
_walletBar = new WalletBar(this);
- KWebWallet *wallet = page()->wallet();
_walletBar.data()->onSaveFormData(key, url);
qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, _walletBar.data() );
-
- connect(_walletBar.data(), SIGNAL(saveFormDataAccepted(const QString &)),
- wallet, SLOT(acceptSaveFormDataRequest(const QString &)));
- connect(_walletBar.data(), SIGNAL(saveFormDataRejected(const QString &)),
- wallet, SLOT(rejectSaveFormDataRequest(const QString &)));
} else {
+ disconnect(wallet);
_walletBar.data()->notifyUser();
}
+
+ connect(_walletBar.data(), SIGNAL(saveFormDataAccepted(const QString &)),
+ wallet, SLOT(acceptSaveFormDataRequest(const QString &)), Qt::UniqueConnection);
+ connect(_walletBar.data(), SIGNAL(saveFormDataRejected(const QString &)),
+ wallet, SLOT(rejectSaveFormDataRequest(const QString &)), Qt::UniqueConnection);
}
@@ -150,14 +151,16 @@ void WebTab::createPreviewSelectorBar(int index)
if(_previewSelectorBar.isNull()) {
_previewSelectorBar = new PreviewSelectorBar(index, this);
qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, _previewSelectorBar.data());
-
- connect(page(), SIGNAL(loadStarted()), _previewSelectorBar.data(), SLOT(loadProgress()));
- connect(page(), SIGNAL(loadProgress(int)), _previewSelectorBar.data(), SLOT(loadProgress()));
- connect(page(), SIGNAL(loadFinished(bool)), _previewSelectorBar.data(), SLOT(loadFinished()));
- connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), _previewSelectorBar.data(), SLOT(verifyUrl()));
} else {
+ disconnect(_previewSelectorBar.data());
+ _previewSelectorBar.data()->setIndex(index);
_previewSelectorBar.data()->notifyUser();
}
+
+ connect(page(), SIGNAL(loadStarted()), _previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
+ connect(page(), SIGNAL(loadProgress(int)), _previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
+ connect(page(), SIGNAL(loadFinished(bool)), _previewSelectorBar.data(), SLOT(loadFinished()), Qt::UniqueConnection);
+ connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), _previewSelectorBar.data(), SLOT(verifyUrl()), Qt::UniqueConnection);
}