1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

Fixed coding style and added copyright

This commit is contained in:
nowrep 2013-09-10 15:45:51 +02:00
parent 655bb6ffeb
commit 4280dcd9fa
4 changed files with 52 additions and 23 deletions

View File

@ -235,11 +235,11 @@ bool BookmarksImportDialog::exportedOK()
IeImporter ie(this);
ie.setFile(ui->fileLine->text());
if(ie.openFile()) {
if (ie.openFile()) {
m_exportedBookmarks = ie.exportBookmarks();
}
if(ie.error()) {
if (ie.error()) {
QMessageBox::critical(this, tr("Error!"), ie.errorString());
}
}

View File

@ -1,3 +1,20 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2013 Mattias Cibien <mattias@mattiascibien.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "ieimporter.h"
#include "bookmarksimportdialog.h"
@ -5,14 +22,13 @@
#include <QDir>
#include <QSettings>
IeImporter::IeImporter(QObject *parent) :
QObject(parent)
IeImporter::IeImporter(QObject* parent)
: QObject(parent)
, m_error(false)
, m_errorString(BookmarksImportDialog::tr("No Error"))
{
}
void IeImporter::setFile(const QString &path)
{
m_path = path;
@ -21,19 +37,18 @@ void IeImporter::setFile(const QString &path)
bool IeImporter::openFile()
{
QDir dir(m_path);
if(!dir.exists()) {
if (!dir.exists()) {
m_error = true;
m_errorString = BookmarksImportDialog::tr("Directory does not exists.");
return false;
}
QStringList filters;
filters << "*.url";
urls = dir.entryInfoList(filters);
if(urls.isEmpty()) {
if (urls.isEmpty()) {
m_error = true;
m_errorString = BookmarksImportDialog::tr("The directory does not contain any bookmarks.");
return false;
@ -42,7 +57,6 @@ bool IeImporter::openFile()
return true;
}
QVector<BookmarksModel::Bookmark> IeImporter::exportBookmarks()
{
QVector<BookmarksModel::Bookmark> bookmarks;

View File

@ -1,3 +1,20 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2013 Mattias Cibien <mattias@mattiascibien.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#ifndef IEIMPORTER_H
#define IEIMPORTER_H
@ -12,7 +29,7 @@ class IeImporter : public QObject
{
Q_OBJECT
public:
explicit IeImporter(QObject *parent = 0);
explicit IeImporter(QObject* parent = 0);
void setFile(const QString &path);
bool openFile();

View File

@ -433,12 +433,11 @@ void NetworkManager::ftpAuthentication(const QUrl &url, QAuthenticator* auth)
void NetworkManager::proxyAuthentication(const QNetworkProxy &proxy, QAuthenticator* auth)
{
QString userName = "";
QString password = "";
QVector<PasswordEntry> psws = MainApplication::getInstance()->autoFill()->getFormData(QUrl(proxy.hostName()));
QString userName;
QString password;
QVector<PasswordEntry> psws = mApp->autoFill()->getFormData(QUrl(proxy.hostName()));
if(psws.isEmpty())
{
if (psws.isEmpty()) {
QDialog* dialog = new QDialog();
dialog->setWindowTitle(tr("Proxy authorisation required"));
@ -460,7 +459,7 @@ void NetworkManager::proxyAuthentication(const QNetworkProxy &proxy, QAuthentica
connect(box, SIGNAL(rejected()), dialog, SLOT(reject()));
connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
QCheckBox *rememberCheck = new QCheckBox("Remember username and password for this proxy.", dialog);
QCheckBox* rememberCheck = new QCheckBox("Remember username and password for this proxy.", dialog);
label->setText(tr("A username and password are being requested by proxy %1. ").arg(proxy.hostName()));
formLa->addRow(label);
@ -473,15 +472,14 @@ void NetworkManager::proxyAuthentication(const QNetworkProxy &proxy, QAuthentica
return;
}
if(rememberCheck->isChecked()) {
MainApplication::getInstance()->autoFill()->addEntry(QUrl(proxy.hostName()), user->text(), pass->text());
if (rememberCheck->isChecked()) {
mApp->autoFill()->addEntry(QUrl(proxy.hostName()), user->text(), pass->text());
}
userName = user->text();
password = pass->text();
}
else
{
else {
userName = psws.at(0).username;
password = psws.at(0).password;
}