Qt: Add back setWindowFilePath

With support for prepend and append to the window title.

Change-Id: I2215a080b85d36ceb47495bbb94617743fc3f83e
Reviewed-on: https://code.wireshark.org/review/13031
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2016-01-12 15:01:45 +01:00
parent b255696c60
commit 91c166867d
1 changed files with 7 additions and 7 deletions

View File

@ -1858,19 +1858,19 @@ void MainWindow::setTitlebarForCaptureFile()
NULL,
NULL,
NULL);
QFileInfo fi(utf8_filename);
if (utf8_filename == NULL) {
if (utf8_filename) {
QFileInfo fi(utf8_filename);
setWSWindowTitle(fi.fileName());
setWindowFilePath(utf8_filename);
g_free(utf8_filename);
} else {
// So what the heck else can we do here?
setWSWindowTitle(tr("(File name can't be mapped to UTF-8)"));
} else {
setWSWindowTitle(fi.fileName());
g_free(utf8_filename);
}
}
setWindowModified(cf_has_unsaved_data(capture_file_.capFile()));
} else {
/* We have no capture file. */
setWindowFilePath(NULL);
setWSWindowTitle();
}
}
@ -1891,11 +1891,11 @@ void MainWindow::setWSWindowTitle(QString title)
}
setWindowTitle(title);
setWindowFilePath(NULL);
}
void MainWindow::setTitlebarForCaptureInProgress()
{
setWindowFilePath(NULL);
if (capture_file_.capFile()) {
setWSWindowTitle(tr("Capturing from %1").arg(cf_get_tempfile_source(capture_file_.capFile())));
} else {