1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Coding style

This commit is contained in:
nowrep 2013-01-16 14:52:50 +01:00
parent b8269b24fb
commit 51f1c73d20
5 changed files with 18 additions and 18 deletions

View File

@ -631,9 +631,9 @@ void BookmarksManager::insertBookmark(const QUrl &url, const QString &title, con
QLabel* label = new QLabel(dialog);
QLineEdit* edit = new QLineEdit(dialog);
QComboBox* combo = new QComboBox(dialog);
BookmarksTree *bookmarksTree = new BookmarksTree(dialog);
connect(bookmarksTree, SIGNAL(requestNewFolder(QWidget*,QString*,bool,QString,WebView*)),
this, SLOT(addFolder(QWidget*,QString*,bool,QString,WebView*)));
BookmarksTree* bookmarksTree = new BookmarksTree(dialog);
connect(bookmarksTree, SIGNAL(requestNewFolder(QWidget*, QString*, bool, QString, WebView*)),
this, SLOT(addFolder(QWidget*, QString*, bool, QString, WebView*)));
bookmarksTree->setViewType(BookmarksTree::ComboFolderView);
bookmarksTree->header()->hide();
bookmarksTree->setColumnCount(1);
@ -658,7 +658,7 @@ void BookmarksManager::insertBookmark(const QUrl &url, const QString &title, con
// QComboBox::find() returns index related to the item's parent
if (index == -1) { // subfolder
QModelIndex rootIndex = combo->rootModelIndex();
combo->setRootModelIndex(combo->model()->index(combo->findText(_bookmarksToolbar),0));
combo->setRootModelIndex(combo->model()->index(combo->findText(_bookmarksToolbar), 0));
index = combo->findText(BookmarksModel::toTranslatedFolder(folder.isEmpty() ? m_bookmarksModel->lastFolder() : folder));
combo->setCurrentIndex(index);
combo->setRootModelIndex(rootIndex);
@ -697,9 +697,9 @@ void BookmarksManager::insertAllTabs()
QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom, dialog);
QLabel* label = new QLabel(dialog);
QComboBox* combo = new QComboBox(dialog);
BookmarksTree *bookmarksTree = new BookmarksTree(dialog);
connect(bookmarksTree, SIGNAL(requestNewFolder(QWidget*,QString*,bool,QString,WebView*)),
this, SLOT(addFolder(QWidget*,QString*,bool,QString,WebView*)));
BookmarksTree* bookmarksTree = new BookmarksTree(dialog);
connect(bookmarksTree, SIGNAL(requestNewFolder(QWidget*, QString*, bool, QString, WebView*)),
this, SLOT(addFolder(QWidget*, QString*, bool, QString, WebView*)));
bookmarksTree->setViewType(BookmarksTree::ComboFolderView);
bookmarksTree->header()->hide();
bookmarksTree->setColumnCount(1);
@ -721,7 +721,7 @@ void BookmarksManager::insertAllTabs()
// QComboBox::find() returns index related to the item's parent
if (index == -1) { // subfolder
QModelIndex rootIndex = combo->rootModelIndex();
combo->setRootModelIndex(combo->model()->index(combo->findText(_bookmarksToolbar),0));
combo->setRootModelIndex(combo->model()->index(combo->findText(_bookmarksToolbar), 0));
index = combo->findText(BookmarksModel::toTranslatedFolder(m_bookmarksModel->lastFolder()));
combo->setCurrentIndex(index);
combo->setRootModelIndex(rootIndex);

View File

@ -56,7 +56,7 @@ private slots:
void deleteItem();
void itemChanged(QTreeWidgetItem* item);
void addSubfolder();
void addFolder(QWidget *parent = 0, QString* folder = 0, bool showInsertDialog = false,
void addFolder(QWidget* parent = 0, QString* folder = 0, bool showInsertDialog = false,
const QString &bookmarkTitle = QString(), WebView* = 0);
void renameFolder();
void contextMenuRequested(const QPoint &position);

View File

@ -24,7 +24,7 @@
#include <QSqlQuery>
#include <QComboBox>
BookmarksTree::BookmarksTree(QWidget *parent)
BookmarksTree::BookmarksTree(QWidget* parent)
: TreeWidget(parent)
, m_viewType(ManagerView)
{
@ -47,7 +47,7 @@ void BookmarksTree::setViewType(BookmarksTree::BookmarkView viewType)
}
}
void BookmarksTree::drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const
void BookmarksTree::drawBranches(QPainter* painter, const QRect &rect, const QModelIndex &index) const
{
if (m_viewType == ComboFolderView) {
return;
@ -111,7 +111,7 @@ void BookmarksTree::refreshTree()
addTopLevelItem(newItem);
}
if (m_viewType == ComboFolderView) {
QTreeWidgetItem *newFolder = new QTreeWidgetItem(rootItem);
QTreeWidgetItem* newFolder = new QTreeWidgetItem(rootItem);
newFolder->setText(0, tr("New Folder..."));
newFolder->setData(0, Qt::UserRole + 12, "NEW_FOLDER");
newFolder->setIcon(0, style()->standardIcon(QStyle::SP_FileDialogNewFolder));
@ -204,7 +204,7 @@ void BookmarksTree::refreshTree()
setUpdatesEnabled(true);
}
void BookmarksTree::activeItemChange(int index, QComboBox *combo, const QString &title, WebView* view)
void BookmarksTree::activeItemChange(int index, QComboBox* combo, const QString &title, WebView* view)
{
if (!combo) {
combo = qobject_cast<QComboBox*>(sender());
@ -225,7 +225,7 @@ void BookmarksTree::activeItemChange(int index, QComboBox *combo, const QString
// QComboBox::find() returns index related to the item's parent
if (ind == -1) {
QModelIndex rootIndex = combo->rootModelIndex();
combo->setRootModelIndex(combo->model()->index(combo->findText(_bookmarksToolbar),0));
combo->setRootModelIndex(combo->model()->index(combo->findText(_bookmarksToolbar), 0));
combo->setCurrentIndex(combo->findText(folder));
combo->setRootModelIndex(rootIndex);
}

View File

@ -64,8 +64,8 @@ BookmarksWidget::BookmarksWidget(QupZilla* mainClass, WebView* view, QWidget* pa
loadBookmark();
connect(ui->folder, SIGNAL(activated(int)), this, SLOT(comboItemActive(int)));
connect(m_bookmarksTree, SIGNAL(requestNewFolder(QWidget*,QString*,bool,QString,WebView*)),
reinterpret_cast<QObject*>(mApp->browsingLibrary()->bookmarksManager()), SLOT(addFolder(QWidget*,QString*,bool,QString,WebView*)));
connect(m_bookmarksTree, SIGNAL(requestNewFolder(QWidget*, QString*, bool, QString, WebView*)),
reinterpret_cast<QObject*>(mApp->browsingLibrary()->bookmarksManager()), SLOT(addFolder(QWidget*, QString*, bool, QString, WebView*)));
}
void BookmarksWidget::loadBookmark()
@ -83,7 +83,7 @@ void BookmarksWidget::loadBookmark()
// QComboBox::findData() returns index related to the item's parent
if (index == -1) { // subfolder
QModelIndex rootIndex = ui->folder->rootModelIndex();
ui->folder->setRootModelIndex(ui->folder->model()->index(ui->folder->findText(_bookmarksToolbar),0));
ui->folder->setRootModelIndex(ui->folder->model()->index(ui->folder->findText(_bookmarksToolbar), 0));
// subfolder's name and its stored data are the same
index = ui->folder->findText(bookmark.folder);
ui->folder->setCurrentIndex(index);

View File

@ -29,7 +29,7 @@
#include <QWebFrame>
#include <QCloseEvent>
PopupWindow::PopupWindow(PopupWebView* view, QupZilla *mainClass)
PopupWindow::PopupWindow(PopupWebView* view, QupZilla* mainClass)
: QWidget()
, p_QupZilla(mainClass)
, m_view(view)