1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-31 11:23:40 +00:00

Fix directory name display in relocate dialog

This commit is contained in:
Mike Gelfand 2014-12-26 14:21:47 +00:00
parent 8a4f8b9e15
commit e9394e2f9b

View file

@ -32,13 +32,14 @@ RelocateDialog::onFileSelected (const QString& path)
myPath = path; myPath = path;
const QFileInfo pathInfo (path); const QFileInfo pathInfo (path);
const QString absolutePath = pathInfo.absoluteFilePath ();
const QFileIconProvider iconProvider; const QFileIconProvider iconProvider;
ui.newLocationButton->setIcon (mySession.isLocal () ? ui.newLocationButton->setIcon (mySession.isLocal () ?
iconProvider.icon (pathInfo) : iconProvider.icon (pathInfo) :
iconProvider.icon (QFileIconProvider::Folder)); iconProvider.icon (QFileIconProvider::Folder));
ui.newLocationButton->setText (pathInfo.baseName ()); ui.newLocationButton->setText (pathInfo.fileName ().isEmpty () ? absolutePath : pathInfo.fileName ());
ui.newLocationButton->setToolTip (path); ui.newLocationButton->setToolTip (absolutePath);
} }
void void