summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-07-09 17:26:36 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-07-09 17:26:36 +0200
commitf3a0c16bd631a2274f25de70ec07159bd932883c (patch)
treee56a8eeb3a6aa99e6895b9852f47db050f3a4210
parentAdd a simple ssh sync handler (diff)
downloadrekonq-f3a0c16bd631a2274f25de70ec07159bd932883c.tar.xz
spaces, indentation, licenses clean up in ssh sync new code
-rw-r--r--src/sync/sshsynchandler.cpp2
-rw-r--r--src/sync/sshsynchandler.h18
-rw-r--r--src/sync/syncassistant.h2
-rw-r--r--src/sync/synccheckwidget.cpp2
-rw-r--r--src/sync/syncdatawidget.cpp20
-rw-r--r--src/sync/syncftpsettingswidget.cpp5
-rw-r--r--src/sync/syncsshsettingswidget.cpp37
-rw-r--r--src/sync/syncsshsettingswidget.h19
8 files changed, 60 insertions, 45 deletions
diff --git a/src/sync/sshsynchandler.cpp b/src/sync/sshsynchandler.cpp
index 06c06861..c87f2acd 100644
--- a/src/sync/sshsynchandler.cpp
+++ b/src/sync/sshsynchandler.cpp
@@ -3,7 +3,7 @@
* This file is a part of the rekonq project
*
* Copyright (C) 2011 by Andrea Diamantini <adjam7 at gmail dot com>
-* Copyright (C) 2013 by Radu Andries <admiral0 at tuxfamily dot org>
+* Copyright (C) 2013 by Radu Andries <admiral0 at tuxfamily dot org>
*
*
* This program is free software; you can redistribute it and/or
diff --git a/src/sync/sshsynchandler.h b/src/sync/sshsynchandler.h
index 4c1718d9..994854ce 100644
--- a/src/sync/sshsynchandler.h
+++ b/src/sync/sshsynchandler.h
@@ -3,7 +3,7 @@
* This file is a part of the rekonq project
*
* Copyright (C) 2011 by Andrea Diamantini <adjam7 at gmail dot com>
-* Copyright (C) 2013 by Radu Andries <admiral0 at tuxfamily dot org>
+* Copyright (C) 2013 by Radu Andries <admiral0 at tuxfamily dot org>
*
*
* This program is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
*
* ============================================================ */
+
#ifndef SSHSYNCHANDLER_H
#define SSHSYNCHANDLER_H
@@ -36,21 +37,20 @@
// Forward Declarations
class KJob;
-class KJob;
class SSHSyncHandler : public SyncHandler
{
Q_OBJECT
public:
- explicit SSHSyncHandler(QObject *parent = 0);
-
- void syncHistory();
- void syncBookmarks();
- void syncPasswords();
+ explicit SSHSyncHandler(QObject *parent = 0);
+
+ void syncHistory();
+ void syncBookmarks();
+ void syncPasswords();
+
+ void initialLoadAndCheck();
- void initialLoadAndCheck();
-
private Q_SLOTS:
void onBookmarksSyncFinished(KJob *);
void onBookmarksStatFinished(KJob *);
diff --git a/src/sync/syncassistant.h b/src/sync/syncassistant.h
index d76df5e1..bf04a298 100644
--- a/src/sync/syncassistant.h
+++ b/src/sync/syncassistant.h
@@ -43,7 +43,7 @@ public:
Page_FTP_Settings,
Page_Google_Settings,
Page_Opera_Settings,
- Page_SSH_Settings,
+ Page_SSH_Settings,
Page_Data,
Page_Check
};
diff --git a/src/sync/synccheckwidget.cpp b/src/sync/synccheckwidget.cpp
index d7748caa..43ea6f05 100644
--- a/src/sync/synccheckwidget.cpp
+++ b/src/sync/synccheckwidget.cpp
@@ -152,8 +152,6 @@ void SyncCheckWidget::initializePage()
}
-
-
void SyncCheckWidget::updateWidget(Rekonq::SyncData type, bool done, QString msg)
{
KIcon doneIcon(QL1S("dialog-ok-apply"));
diff --git a/src/sync/syncdatawidget.cpp b/src/sync/syncdatawidget.cpp
index 5624c45f..bddc83eb 100644
--- a/src/sync/syncdatawidget.cpp
+++ b/src/sync/syncdatawidget.cpp
@@ -42,33 +42,37 @@ SyncDataWidget::SyncDataWidget(QWidget *parent)
setupUi(this);
}
+
void SyncDataWidget::initializePage()
{
-
kcfg_syncBookmarks->setDisabled(true);
kcfg_syncHistory->setDisabled(true);
kcfg_syncPasswords->setDisabled(true);
switch (ReKonfig::syncType())
{
- //Ftp Sync Handler
+ // Ftp Sync Handler
case 0:
kcfg_syncBookmarks->setEnabled(true);
kcfg_syncHistory->setEnabled(true);
kcfg_syncPasswords->setEnabled(true);
break;
- //Google Sync Handler
+
+ // Google Sync Handler
case 1:
- //Opera Sync Handler
+
+ // Opera Sync Handler
case 2:
kcfg_syncBookmarks->setEnabled(true);
break;
+
+ // SSH sync handler
case 3:
- //SSH sync handler
- kcfg_syncBookmarks->setEnabled(true);
+ kcfg_syncBookmarks->setEnabled(true);
kcfg_syncHistory->setEnabled(true);
kcfg_syncPasswords->setEnabled(true);
- break;
+ break;
+
default:
kDebug() << "Unknown sync type!";
}
@@ -76,14 +80,12 @@ void SyncDataWidget::initializePage()
kcfg_syncBookmarks->setChecked(ReKonfig::syncBookmarks());
kcfg_syncHistory->setChecked(ReKonfig::syncHistory());
kcfg_syncPasswords->setChecked(ReKonfig::syncPasswords());
-
}
int SyncDataWidget::nextId() const
{
// save
-
ReKonfig::setSyncBookmarks(kcfg_syncBookmarks->isChecked());
ReKonfig::setSyncHistory(kcfg_syncHistory->isChecked());
ReKonfig::setSyncPasswords(kcfg_syncPasswords->isChecked());
diff --git a/src/sync/syncftpsettingswidget.cpp b/src/sync/syncftpsettingswidget.cpp
index 14924f38..eb7946e7 100644
--- a/src/sync/syncftpsettingswidget.cpp
+++ b/src/sync/syncftpsettingswidget.cpp
@@ -41,8 +41,9 @@ SyncFTPSettingsWidget::SyncFTPSettingsWidget(QWidget *parent)
setupUi(this);
int port = ReKonfig::syncPort();
- if(port == -1){
- port=21;
+ if (port == -1)
+ {
+ port = 21;
}
kcfg_syncHost->setText(ReKonfig::syncHost());
diff --git a/src/sync/syncsshsettingswidget.cpp b/src/sync/syncsshsettingswidget.cpp
index cd89193d..10583993 100644
--- a/src/sync/syncsshsettingswidget.cpp
+++ b/src/sync/syncsshsettingswidget.cpp
@@ -2,7 +2,7 @@
*
* This file is a part of the rekonq project
*
-* Copyright (C) 2013 by Radu Andries <admiral0 at tuxfamily dot org>
+* Copyright (C) 2013 by Radu Andries <admiral0 at tuxfamily dot org>
*
*
* This program is free software; you can redistribute it and/or
@@ -23,7 +23,10 @@
*
* ============================================================ */
+
+// Self Includes
#include "syncsshsettingswidget.h"
+#include "syncsshsettingswidget.moc"
// Auto Includes
#include "rekonq.h"
@@ -33,6 +36,7 @@
// Local Includes
#include "syncassistant.h"
+
int SyncSSHSettingsWidget::nextId() const
{
// save
@@ -45,13 +49,15 @@ int SyncSSHSettingsWidget::nextId() const
return SyncAssistant::Page_Data;
}
+
SyncSSHSettingsWidget::SyncSSHSettingsWidget(QWidget* parent): QWizardPage(parent)
{
setupUi(this);
int port = ReKonfig::syncPort();
- if(port == -1){
- port=22;
+ if (port == -1)
+ {
+ port = 22;
}
kcfg_syncHost->setText(ReKonfig::syncHost());
@@ -60,9 +66,10 @@ SyncSSHSettingsWidget::SyncSSHSettingsWidget(QWidget* parent): QWizardPage(paren
kcfg_syncPath->setText(ReKonfig::syncPath());
kcfg_syncPort->setValue(port);
- if(kcfg_syncPass->text().isEmpty()){
- syncWithSSHKeys->setChecked(true);
- toggleUserPass(true);
+ if (kcfg_syncPass->text().isEmpty())
+ {
+ syncWithSSHKeys->setChecked(true);
+ toggleUserPass(true);
}
kcfg_syncPass->setPasswordMode(true);
@@ -70,14 +77,16 @@ SyncSSHSettingsWidget::SyncSSHSettingsWidget(QWidget* parent): QWizardPage(paren
connect(syncWithSSHKeys,SIGNAL(toggled(bool)),SLOT(toggleUserPass(bool)));
}
+
void SyncSSHSettingsWidget::toggleUserPass(bool enabled)
{
- if(enabled){
- kcfg_syncPass->setText("");
- kcfg_syncPass->setEnabled(false);
- }else{
- kcfg_syncPass->setEnabled(true);
- }
+ if (enabled)
+ {
+ kcfg_syncPass->setText(QL1S(""));
+ kcfg_syncPass->setEnabled(false);
+ }
+ else
+ {
+ kcfg_syncPass->setEnabled(true);
+ }
}
-
-
diff --git a/src/sync/syncsshsettingswidget.h b/src/sync/syncsshsettingswidget.h
index 051be78e..92a3ad35 100644
--- a/src/sync/syncsshsettingswidget.h
+++ b/src/sync/syncsshsettingswidget.h
@@ -2,7 +2,7 @@
*
* This file is a part of the rekonq project
*
-* Copyright (C) 2013 by Radu Andries <admiral0 at tuxfamily dot org>
+* Copyright (C) 2013 by Radu Andries <admiral0 at tuxfamily dot org>
*
*
* This program is free software; you can redistribute it and/or
@@ -22,24 +22,29 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ============================================================ */
+
+
#ifndef SYNCSSHSETTINGSWIDGET_H
#define SYNCSSHSETTINGSWIDGET_H
+// Qt Includes
#include <QWizardPage>
+// Ui Includes
#include "ui_sync_ssh_settings.h"
+
class SyncSSHSettingsWidget : public QWizardPage, private Ui::SyncSSHSettings
{
Q_OBJECT
+
public:
-
- explicit SyncSSHSettingsWidget(QWidget *parent = 0);
+ explicit SyncSSHSettingsWidget(QWidget *parent = 0);
+
+ int nextId() const;
- int nextId() const;
-
-private slots:
- void toggleUserPass(bool enabled);
+private Q_SLOTS:
+ void toggleUserPass(bool enabled);
};
#endif // SYNCSSHSETTINGSWIDGET_H