diff options
| author | Tannin <devnull@localhost> | 2015-06-09 20:40:13 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-06-09 20:40:13 +0200 |
| commit | d7790cd717639bd38a626aef3735326a39808684 (patch) | |
| tree | 59986a0ad09eaf1d773ee0e60328c73d4df7f576 | |
| parent | 84d632af6af725ad4c5a5ef9bc5a891d00b252b5 (diff) | |
incorrect use of "complete" file suffixes
| -rw-r--r-- | src/mainwindow.cpp | 4 | ||||
| -rw-r--r-- | src/previewgenerator.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 952c3178..7c0804f8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3468,7 +3468,7 @@ void MainWindow::writeDataToFile() int MainWindow::getBinaryExecuteInfo(const QFileInfo &targetInfo, QFileInfo &binaryInfo, QString &arguments)
{
- QString extension = targetInfo.completeSuffix();
+ QString extension = targetInfo.suffix();
if ((extension.compare("cmd", Qt::CaseInsensitive) == 0) ||
(extension.compare("com", Qt::CaseInsensitive) == 0) ||
(extension.compare("bat", Qt::CaseInsensitive) == 0)) {
@@ -3723,7 +3723,7 @@ void MainWindow::on_dataTree_customContextMenuRequested(const QPoint &pos) menu.addAction(tr("Add as Executable"), this, SLOT(addAsExecutable()));
QString fileName = m_ContextItem->text(0);
- if (m_PluginContainer.previewGenerator().previewSupported(QFileInfo(fileName).completeSuffix())) {
+ if (m_PluginContainer.previewGenerator().previewSupported(QFileInfo(fileName).suffix())) {
menu.addAction(tr("Preview"), this, SLOT(previewDataFile()));
}
diff --git a/src/previewgenerator.cpp b/src/previewgenerator.cpp index 764d016d..280d69aa 100644 --- a/src/previewgenerator.cpp +++ b/src/previewgenerator.cpp @@ -34,7 +34,7 @@ PreviewGenerator::PreviewGenerator() void PreviewGenerator::registerPlugin(MOBase::IPluginPreview *plugin)
{
- foreach (const QString &extension, plugin->supportedExtensions()) {
+ for (const QString &extension : plugin->supportedExtensions()) {
m_PreviewPlugins.insert(std::make_pair(extension, plugin));
}
}
@@ -46,7 +46,7 @@ bool PreviewGenerator::previewSupported(const QString &fileExtension) const QWidget *PreviewGenerator::genPreview(const QString &fileName) const
{
- auto iter = m_PreviewPlugins.find(QFileInfo(fileName).completeSuffix().toLower());
+ auto iter = m_PreviewPlugins.find(QFileInfo(fileName).suffix().toLower());
if (iter != m_PreviewPlugins.end()) {
return iter->second->genFilePreview(fileName, m_MaxSize);
} else {
|
