mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 16:07:23 -06:00
Rename "fromNativePath" to "toUniformPath"
Unlike "toNativePath" which name clearly reflects the function result "fromNativePath" has no such clear meaning. Since this function converts path into uniform format "toUniformPath" is better name.
This commit is contained in:
@@ -201,7 +201,7 @@ FileSystemPathEdit::~FileSystemPathEdit()
|
||||
|
||||
QString FileSystemPathEdit::selectedPath() const
|
||||
{
|
||||
return Utils::Fs::fromNativePath(editWidgetText());
|
||||
return Utils::Fs::toUniformPath(editWidgetText());
|
||||
}
|
||||
|
||||
void FileSystemPathEdit::setSelectedPath(const QString &val)
|
||||
@@ -347,7 +347,7 @@ int FileSystemPathComboEdit::count() const
|
||||
|
||||
QString FileSystemPathComboEdit::item(int index) const
|
||||
{
|
||||
return Utils::Fs::fromNativePath(editWidget<WidgetType>()->itemText(index));
|
||||
return Utils::Fs::toUniformPath(editWidget<WidgetType>()->itemText(index));
|
||||
}
|
||||
|
||||
void FileSystemPathComboEdit::addItem(const QString &text)
|
||||
|
||||
@@ -1368,9 +1368,9 @@ void MainWindow::on_actionOpen_triggered()
|
||||
}
|
||||
|
||||
// Save last dir to remember it
|
||||
QStringList topDir = Utils::Fs::fromNativePath(pathsList.at(0)).split('/');
|
||||
QStringList topDir = Utils::Fs::toUniformPath(pathsList.at(0)).split('/');
|
||||
topDir.removeLast();
|
||||
pref->setMainLastDir(Utils::Fs::fromNativePath(topDir.join('/')));
|
||||
pref->setMainLastDir(Utils::Fs::toUniformPath(topDir.join('/')));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -373,7 +373,7 @@ void PluginSelectDialog::iconDownloadFinished(const Net::DownloadResult &result)
|
||||
return;
|
||||
}
|
||||
|
||||
const QString filePath = Utils::Fs::fromNativePath(result.filePath);
|
||||
const QString filePath = Utils::Fs::toUniformPath(result.filePath);
|
||||
|
||||
// Icon downloaded
|
||||
QIcon icon(filePath);
|
||||
|
||||
@@ -469,7 +469,7 @@ void TorrentContentModel::setupModelData(const BitTorrent::TorrentInfo &info)
|
||||
// Iterate over files
|
||||
for (int i = 0; i < filesCount; ++i) {
|
||||
currentParent = m_rootItem;
|
||||
QString path = Utils::Fs::fromNativePath(info.filePath(i));
|
||||
QString path = Utils::Fs::toUniformPath(info.filePath(i));
|
||||
// Iterate of parts of the path to create necessary folders
|
||||
QStringList pathFolders = path.split('/', QString::SkipEmptyParts);
|
||||
pathFolders.removeLast();
|
||||
|
||||
@@ -139,7 +139,7 @@ void TorrentCreatorDialog::dragEnterEvent(QDragEnterEvent *event)
|
||||
// Main function that create a .torrent file
|
||||
void TorrentCreatorDialog::onCreateButtonClicked()
|
||||
{
|
||||
QString input = Utils::Fs::fromNativePath(m_ui->textInputPath->text()).trimmed();
|
||||
QString input = Utils::Fs::toUniformPath(m_ui->textInputPath->text()).trimmed();
|
||||
|
||||
// test if readable
|
||||
const QFileInfo fi(input);
|
||||
|
||||
@@ -154,7 +154,7 @@ QPoint Utils::Gui::screenCenter(const QWidget *w)
|
||||
// Open the given path with an appropriate application
|
||||
void Utils::Gui::openPath(const QString &absolutePath)
|
||||
{
|
||||
const QString path = Utils::Fs::fromNativePath(absolutePath);
|
||||
const QString path = Utils::Fs::toUniformPath(absolutePath);
|
||||
// Hack to access samba shares with QDesktopServices::openUrl
|
||||
if (path.startsWith("//"))
|
||||
QDesktopServices::openUrl(Utils::Fs::toNativePath("file:" + path));
|
||||
@@ -166,7 +166,7 @@ void Utils::Gui::openPath(const QString &absolutePath)
|
||||
// (if possible) the item at the given path
|
||||
void Utils::Gui::openFolderSelect(const QString &absolutePath)
|
||||
{
|
||||
const QString path = Utils::Fs::fromNativePath(absolutePath);
|
||||
const QString path = Utils::Fs::toUniformPath(absolutePath);
|
||||
// If the item to select doesn't exist, try to open its parent
|
||||
if (!QFileInfo::exists(path)) {
|
||||
openPath(path.left(path.lastIndexOf('/')));
|
||||
|
||||
Reference in New Issue
Block a user