mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 05:38:06 -06:00
Coding style clean up
This commit is contained in:
@@ -55,7 +55,7 @@ public:
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(validateInput()));
|
||||
}
|
||||
|
||||
~PeerAdditionDlg(){}
|
||||
~PeerAdditionDlg() {}
|
||||
|
||||
QString getIP() const {
|
||||
QHostAddress ip(lineIP->text());
|
||||
|
||||
@@ -43,14 +43,14 @@ public:
|
||||
TOT_DOWN, TOT_UP, IP_HIDDEN, COL_COUNT};
|
||||
|
||||
public:
|
||||
PeerListDelegate(QObject *parent) : QItemDelegate(parent){}
|
||||
PeerListDelegate(QObject *parent) : QItemDelegate(parent) {}
|
||||
|
||||
~PeerListDelegate(){}
|
||||
~PeerListDelegate() {}
|
||||
|
||||
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const{
|
||||
painter->save();
|
||||
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
|
||||
switch(index.column()){
|
||||
switch(index.column()) {
|
||||
case TOT_DOWN:
|
||||
case TOT_UP:
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
|
||||
@@ -400,12 +400,12 @@ void PropertiesWidget::loadDynamicData() {
|
||||
} catch(invalid_handle e) {}
|
||||
}
|
||||
|
||||
void PropertiesWidget::loadUrlSeeds(){
|
||||
void PropertiesWidget::loadUrlSeeds() {
|
||||
listWebSeeds->clear();
|
||||
qDebug("Loading URL seeds");
|
||||
const QStringList hc_seeds = h.url_seeds();
|
||||
// Add url seeds
|
||||
foreach (const QString &hc_seed, hc_seeds){
|
||||
foreach (const QString &hc_seed, hc_seeds) {
|
||||
qDebug("Loading URL seed: %s", qPrintable(hc_seed));
|
||||
new QListWidgetItem(hc_seed, listWebSeeds);
|
||||
}
|
||||
@@ -450,7 +450,7 @@ void PropertiesWidget::openDoubleClickedFile(QModelIndex index) {
|
||||
}
|
||||
}
|
||||
|
||||
void PropertiesWidget::displayFilesListMenu(const QPoint&){
|
||||
void PropertiesWidget::displayFilesListMenu(const QPoint&) {
|
||||
QMenu myFilesLlistMenu;
|
||||
QModelIndexList selectedRows = filesList->selectionModel()->selectedRows(0);
|
||||
QAction *actRename = 0;
|
||||
@@ -616,7 +616,7 @@ void PropertiesWidget::renameSelectedFile() {
|
||||
}
|
||||
}
|
||||
|
||||
void PropertiesWidget::askWebSeed(){
|
||||
void PropertiesWidget::askWebSeed() {
|
||||
bool ok;
|
||||
// Ask user for a new url seed
|
||||
const QString url_seed = QInputDialog::getText(this, tr("New url seed", "New HTTP source"),
|
||||
@@ -635,15 +635,15 @@ void PropertiesWidget::askWebSeed(){
|
||||
loadUrlSeeds();
|
||||
}
|
||||
|
||||
void PropertiesWidget::deleteSelectedUrlSeeds(){
|
||||
void PropertiesWidget::deleteSelectedUrlSeeds() {
|
||||
const QList<QListWidgetItem *> selectedItems = listWebSeeds->selectedItems();
|
||||
bool change = false;
|
||||
foreach (const QListWidgetItem *item, selectedItems){
|
||||
foreach (const QListWidgetItem *item, selectedItems) {
|
||||
QString url_seed = item->text();
|
||||
h.remove_url_seed(url_seed);
|
||||
change = true;
|
||||
}
|
||||
if (change){
|
||||
if (change) {
|
||||
// Refresh list
|
||||
loadUrlSeeds();
|
||||
}
|
||||
@@ -674,7 +674,7 @@ void PropertiesWidget::on_changeSavePathButton_clicked() {
|
||||
new_path = QFileDialog::getExistingDirectory(this, tr("Choose save path"), saveDir.absolutePath(),
|
||||
QFileDialog::DontConfirmOverwrite|QFileDialog::ShowDirsOnly|QFileDialog::HideNameFilterDetails);
|
||||
}
|
||||
if (!new_path.isEmpty()){
|
||||
if (!new_path.isEmpty()) {
|
||||
// Check if savePath exists
|
||||
QString save_path_dir = new_path.replace("\\", "/");
|
||||
QString new_file_name;
|
||||
|
||||
@@ -60,15 +60,15 @@ signals:
|
||||
void filteredFilesChanged() const;
|
||||
|
||||
public:
|
||||
PropListDelegate(PropertiesWidget* properties=0, QObject *parent=0) : QItemDelegate(parent), properties(properties){
|
||||
PropListDelegate(PropertiesWidget* properties=0, QObject *parent=0) : QItemDelegate(parent), properties(properties) {
|
||||
}
|
||||
|
||||
~PropListDelegate(){}
|
||||
~PropListDelegate() {}
|
||||
|
||||
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const{
|
||||
painter->save();
|
||||
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
|
||||
switch(index.column()){
|
||||
switch(index.column()) {
|
||||
case PCSIZE:
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong()));
|
||||
|
||||
@@ -108,7 +108,7 @@ void TrackerList::moveSelectionUp() {
|
||||
QList<QTreeWidgetItem *> selected_items = getSelectedTrackerItems();
|
||||
if (selected_items.isEmpty()) return;
|
||||
bool change = false;
|
||||
foreach (QTreeWidgetItem *item, selected_items){
|
||||
foreach (QTreeWidgetItem *item, selected_items) {
|
||||
int index = indexOfTopLevelItem(item);
|
||||
if (index > NB_STICKY_ITEM) {
|
||||
insertTopLevelItem(index-1, takeTopLevelItem(index));
|
||||
@@ -273,7 +273,7 @@ void TrackerList::loadTrackers() {
|
||||
}
|
||||
|
||||
// Ask the user for new trackers and add them to the torrent
|
||||
void TrackerList::askForTrackers(){
|
||||
void TrackerList::askForTrackers() {
|
||||
QTorrentHandle h = properties->getCurrentTorrent();
|
||||
if (!h.is_valid()) return;
|
||||
QStringList trackers = TrackersAdditionDlg::askForTrackers(h);
|
||||
@@ -291,7 +291,7 @@ void TrackerList::askForTrackers(){
|
||||
}
|
||||
}
|
||||
|
||||
void TrackerList::deleteSelectedTrackers(){
|
||||
void TrackerList::deleteSelectedTrackers() {
|
||||
QTorrentHandle h = properties->getCurrentTorrent();
|
||||
if (!h.is_valid()) {
|
||||
clear();
|
||||
@@ -300,7 +300,7 @@ void TrackerList::deleteSelectedTrackers(){
|
||||
QList<QTreeWidgetItem *> selected_items = getSelectedTrackerItems();
|
||||
if (selected_items.isEmpty()) return;
|
||||
QStringList urls_to_remove;
|
||||
foreach (QTreeWidgetItem *item, selected_items){
|
||||
foreach (QTreeWidgetItem *item, selected_items) {
|
||||
QString tracker_url = item->data(COL_URL, Qt::DisplayRole).toString();
|
||||
urls_to_remove << tracker_url;
|
||||
tracker_items.remove(tracker_url);
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
list_url->setCursorPosition(0);
|
||||
}
|
||||
|
||||
~TrackersAdditionDlg(){}
|
||||
~TrackersAdditionDlg() {}
|
||||
|
||||
QStringList newTrackers() const {
|
||||
return trackers_list->toPlainText().trimmed().split("\n");
|
||||
|
||||
Reference in New Issue
Block a user