From 1c9018e9fdba7878b0ef605f81529c20ef3bbffe Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 13 Apr 2013 19:23:18 +0200 Subject: - bugfix: wrong multibyte to widechar conversion in hookdll breaks internationalization - bugfix: mod names not checked for validity on rename - bugfix: mod list wasn't invalidated after rename (regression?) - problem reports moved to separate dialog - ncc plugin now does the check for dotNet - python plugin wrapper started (only supports tools currently) - new ini editor plugin in python (non-functional currently) --- src/modlist.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index f186ce8e..2183ce09 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -20,12 +20,11 @@ along with Mod Organizer. If not, see . #include "modlist.h" #include "report.h" -#include "utility.h" #include "messagedialog.h" #include "installationtester.h" #include "qtgroupingproxy.h" #include - +#include #include #include #include @@ -301,19 +300,25 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const bool ModList::renameMod(int index, const QString &newName) { + QString nameFixed = newName; + if (!fixDirectoryName(nameFixed) || nameFixed.isEmpty()) { + MessageDialog::showMessage(tr("Invalid name"), NULL); + return false; + } + // before we rename, write back the current profile so we don't lose changes and to ensure // there is no scheduled asynchronous rewrite anytime soon m_Profile->writeModlistNow(); ModInfo::Ptr modInfo = ModInfo::getByIndex(index); QString oldName = modInfo->name(); - modInfo->setName(newName); + modInfo->setName(nameFixed); // this just broke all profiles! The recipient of modRenamed has to do some magic // to can't write the currently active profile back - emit modRenamed(oldName, newName); + emit modRenamed(oldName, nameFixed); // invalidate the currently displayed state of this list -// notifyChange(-1); + notifyChange(-1); return true; } -- cgit v1.3.1