mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
Add global.h file
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/sessionstatus.h"
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
#include "base/global.h"
|
||||
#include "base/rss/rss_folder.h"
|
||||
#include "base/rss/rss_session.h"
|
||||
|
||||
@@ -1152,7 +1153,7 @@ void MainWindow::dropEvent(QDropEvent *event)
|
||||
// differentiate ".torrent" files and others
|
||||
QStringList torrentFiles, otherFiles;
|
||||
foreach (const QString &file, files) {
|
||||
if (file.endsWith(".torrent", Qt::CaseInsensitive))
|
||||
if (file.endsWith(C_TORRENT_FILE_EXTENSION, Qt::CaseInsensitive))
|
||||
torrentFiles << file;
|
||||
else
|
||||
otherFiles << file;
|
||||
@@ -1203,7 +1204,7 @@ void MainWindow::on_actionOpen_triggered()
|
||||
// Note: it is possible to select more than one file
|
||||
const QStringList pathsList =
|
||||
QFileDialog::getOpenFileNames(this, tr("Open Torrent Files"), pref->getMainLastDir(),
|
||||
tr("Torrent Files") + " (*.torrent)");
|
||||
tr("Torrent Files") + " (*" + C_TORRENT_FILE_EXTENSION + ')');
|
||||
|
||||
const bool useTorrentAdditionDialog = AddNewTorrentDialog::isEnabled();
|
||||
if (!pathsList.isEmpty()) {
|
||||
|
||||
@@ -38,11 +38,11 @@
|
||||
#include <QUrl>
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/torrentinfo.h"
|
||||
#include "base/bittorrent/torrentcreatorthread.h"
|
||||
#include "base/bittorrent/torrentinfo.h"
|
||||
#include "base/global.h"
|
||||
#include "base/settingsstorage.h"
|
||||
#include "base/utils/fs.h"
|
||||
#include "guiiconprovider.h"
|
||||
|
||||
#include "ui_torrentcreatordlg.h"
|
||||
|
||||
@@ -161,8 +161,8 @@ void TorrentCreatorDlg::onCreateButtonClicked()
|
||||
QString destination = QFileDialog::getSaveFileName(this, tr("Select where to save the new torrent"), lastPath, tr("Torrent Files (*.torrent)"));
|
||||
if (destination.isEmpty())
|
||||
return;
|
||||
if (!destination.endsWith(".torrent", Qt::CaseInsensitive))
|
||||
destination += ".torrent";
|
||||
if (!destination.endsWith(C_TORRENT_FILE_EXTENSION, Qt::CaseInsensitive))
|
||||
destination += C_TORRENT_FILE_EXTENSION;
|
||||
storeLastSavePath = Utils::Fs::branchPath(destination);
|
||||
|
||||
// Disable dialog & set busy cursor
|
||||
|
||||
Reference in New Issue
Block a user