1
0
Fork 0

GUI: removed fromUtf8

This commit is contained in:
mrexodia 2016-09-06 00:41:18 +02:00
parent 4e2636416c
commit eff69a9a8c
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
12 changed files with 52 additions and 52 deletions

View File

@ -14,7 +14,7 @@ void HistoryLineEdit::loadSettings(QString sectionPrefix)
QString("Line%1").arg(i).toUtf8().constData(),
buffer) && buffer[0] && i < mCmdHistoryMaxSize; i++)
{
QString entry = QString::fromUtf8(buffer);
QString entry = QString(buffer);
mCmdHistory.append(entry);
}
}

View File

@ -607,9 +607,9 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
QString description;
if(param1 == nullptr)
return nullptr;
name = QString::fromUtf8((const char*)param1);
name = QString((const char*)param1);
if(param2 != nullptr)
description = QString::fromUtf8((const char*)param2);
description = QString((const char*)param2);
emit addFavouriteItem(0, name, description);
}
break;
@ -620,9 +620,9 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
QString shortcut;
if(param1 == nullptr)
return nullptr;
name = QString::fromUtf8((const char*)param1);
name = QString((const char*)param1);
if(param2 != nullptr)
shortcut = QString::fromUtf8((const char*)param2);
shortcut = QString((const char*)param2);
emit addFavouriteItem(2, name, shortcut);
}
break;
@ -633,9 +633,9 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
QString shortcut;
if(param1 == nullptr)
return nullptr;
name = QString::fromUtf8((const char*)param1);
name = QString((const char*)param1);
if(param2 != nullptr)
shortcut = QString::fromUtf8((const char*)param2);
shortcut = QString((const char*)param2);
emit setFavouriteItemShortcut(0, name, shortcut);
}
break;

View File

@ -122,14 +122,14 @@ void BreakpointsView::reloadData()
{
QString addr_text = QString("%1").arg(wBPList.bp[wI].addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
mHardBPTable->setCellContent(wI, 0, addr_text);
mHardBPTable->setCellContent(wI, 1, QString::fromUtf8(wBPList.bp[wI].name));
mHardBPTable->setCellContent(wI, 1, QString(wBPList.bp[wI].name));
QString label_text;
char label[MAX_LABEL_SIZE] = "";
if(DbgGetLabelAt(wBPList.bp[wI].addr, SEG_DEFAULT, label))
label_text = "<" + QString::fromUtf8(wBPList.bp[wI].mod) + "." + QString::fromUtf8(label) + ">";
label_text = "<" + QString(wBPList.bp[wI].mod) + "." + QString(label) + ">";
else
label_text = QString::fromUtf8(wBPList.bp[wI].mod);
label_text = QString(wBPList.bp[wI].mod);
mHardBPTable->setCellContent(wI, 2, label_text);
if(wBPList.bp[wI].active == false)
@ -163,14 +163,14 @@ void BreakpointsView::reloadData()
{
QString addr_text = QString("%1").arg(wBPList.bp[wI].addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
mSoftBPTable->setCellContent(wI, 0, addr_text);
mSoftBPTable->setCellContent(wI, 1, QString::fromUtf8(wBPList.bp[wI].name));
mSoftBPTable->setCellContent(wI, 1, QString(wBPList.bp[wI].name));
QString label_text;
char label[MAX_LABEL_SIZE] = "";
if(DbgGetLabelAt(wBPList.bp[wI].addr, SEG_DEFAULT, label))
label_text = "<" + QString::fromUtf8(wBPList.bp[wI].mod) + "." + QString::fromUtf8(label) + ">";
label_text = "<" + QString(wBPList.bp[wI].mod) + "." + QString(label) + ">";
else
label_text = QString::fromUtf8(wBPList.bp[wI].mod);
label_text = QString(wBPList.bp[wI].mod);
mSoftBPTable->setCellContent(wI, 2, label_text);
if(wBPList.bp[wI].active == false)
@ -203,14 +203,14 @@ void BreakpointsView::reloadData()
{
QString addr_text = QString("%1").arg(wBPList.bp[wI].addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
mMemBPTable->setCellContent(wI, 0, addr_text);
mMemBPTable->setCellContent(wI, 1, QString::fromUtf8(wBPList.bp[wI].name));
mMemBPTable->setCellContent(wI, 1, QString(wBPList.bp[wI].name));
QString label_text;
char label[MAX_LABEL_SIZE] = "";
if(DbgGetLabelAt(wBPList.bp[wI].addr, SEG_DEFAULT, label))
label_text = "<" + QString::fromUtf8(wBPList.bp[wI].mod) + "." + QString::fromUtf8(label) + ">";
label_text = "<" + QString(wBPList.bp[wI].mod) + "." + QString(label) + ">";
else
label_text = QString::fromUtf8(wBPList.bp[wI].mod);
label_text = QString(wBPList.bp[wI].mod);
mMemBPTable->setCellContent(wI, 2, label_text);
if(wBPList.bp[wI].active == false)
@ -239,8 +239,8 @@ void BreakpointsView::reloadData()
mDLLBPTable->setRowCount(wBPList.count);
for(wI = 0; wI < wBPList.count; wI++)
{
mDLLBPTable->setCellContent(wI, 0, QString::fromUtf8(wBPList.bp[wI].name));
mDLLBPTable->setCellContent(wI, 1, QString::fromUtf8(wBPList.bp[wI].mod));
mDLLBPTable->setCellContent(wI, 0, QString(wBPList.bp[wI].name));
mDLLBPTable->setCellContent(wI, 1, QString(wBPList.bp[wI].mod));
if(wBPList.bp[wI].active == false)
mDLLBPTable->setCellContent(wI, 2, tr("Inactive"));
@ -814,7 +814,7 @@ void BreakpointsView::DLLBPContextMenuSlot(const QPoint & pos)
for(wI = 0; wI < wBPList.count; wI++)
{
if(QString::fromUtf8(wBPList.bp[wI].mod) == wName)
if(QString(wBPList.bp[wI].mod) == wName)
{
if(wBPList.bp[wI].active == false)
{

View File

@ -205,7 +205,7 @@ void CPUSideBar::paintEvent(QPaintEvent* event)
{
if(WatchList[i].varType == WATCHVARTYPE::TYPE_UINT || WatchList[i].varType == WATCHVARTYPE::TYPE_ASCII || WatchList[i].varType == WATCHVARTYPE::TYPE_UNICODE)
{
appendReg(QString::fromUtf8(WatchList[i].WatchName), WatchList[i].value);
appendReg(QString(WatchList[i].WatchName), WatchList[i].value);
}
}
}

View File

@ -12,7 +12,7 @@ EditBreakpointDialog::EditBreakpointDialog(QWidget* parent, const BRIDGEBP & bp)
setFixedSize(this->size()); //fixed size
if(bp.type == bp_dll)
{
setWindowTitle(QString(tr("Edit Breakpoint %1")).arg(QString::fromUtf8(bp.mod)));
setWindowTitle(QString(tr("Edit Breakpoint %1")).arg(QString(bp.mod)));
}
else
{

View File

@ -38,10 +38,10 @@ FavouriteTools::FavouriteTools(QWidget* parent) :
std::vector<QString> allToolShortcut;
for(i = 1; BridgeSettingGet("Favourite", QString("Command%1").arg(i).toUtf8().constData(), buffer); i++)
{
QString command = QString::fromUtf8(buffer);
QString command = QString(buffer);
QString commandShortcut("");
if(BridgeSettingGet("Favourite", QString("CommandShortcut%1").arg(i).toUtf8().constData(), buffer))
commandShortcut = QString::fromUtf8(buffer);
commandShortcut = QString(buffer);
allCommand.push_back(command);
allToolShortcut.push_back(commandShortcut);
}
@ -89,13 +89,13 @@ void FavouriteTools::setupTools(QString name, QTableWidget* list)
std::vector<QString> allToolDescription;
for(i = 1; BridgeSettingGet("Favourite", (name + QString::number(i)).toUtf8().constData(), buffer); i++)
{
QString toolPath = QString::fromUtf8(buffer);
QString toolPath = QString(buffer);
QString toolShortcut("");
QString toolDescription("");
if(BridgeSettingGet("Favourite", (name + "Shortcut" + QString::number(i)).toUtf8().constData(), buffer))
toolShortcut = QString::fromUtf8(buffer);
toolShortcut = QString(buffer);
if(BridgeSettingGet("Favourite", (name + "Description" + QString::number(i)).toUtf8().constData(), buffer))
toolDescription = QString::fromUtf8(buffer);
toolDescription = QString(buffer);
allToolPath.push_back(toolPath);
allToolShortcut.push_back(toolShortcut);
allToolDescription.push_back(toolDescription);
@ -120,7 +120,7 @@ void FavouriteTools::on_btnAddFavouriteTool_clicked()
char buffer[MAX_SETTING_SIZE];
memset(buffer, 0, sizeof(buffer));
BridgeSettingGet("Favourite", "LastToolPath", buffer);
BrowseDialog browse(this, QString("Browse tool"), QString("Enter the path of the tool."), QString("Executable Files (*.exe);;All Files (*.*)"), QString::fromUtf8(buffer), false);
BrowseDialog browse(this, QString("Browse tool"), QString("Enter the path of the tool."), QString("Executable Files (*.exe);;All Files (*.*)"), QString(buffer), false);
if(browse.exec() != QDialog::Accepted && browse.path.length())
return;
filename = browse.path;
@ -143,7 +143,7 @@ void FavouriteTools::on_btnEditFavouriteTool_clicked()
char buffer[MAX_SETTING_SIZE];
memset(buffer, 0, sizeof(buffer));
BridgeSettingGet("Favourite", "LastToolPath", buffer);
BrowseDialog browse(this, QString("Browse tool"), QString("Enter the path of the tool."), QString("Executable Files (*.exe);;All Files (*.*)"), QString::fromUtf8(buffer), false);
BrowseDialog browse(this, QString("Browse tool"), QString("Enter the path of the tool."), QString("Executable Files (*.exe);;All Files (*.*)"), QString(buffer), false);
if(browse.exec() != QDialog::Accepted && browse.path.length())
return;
filename = browse.path;
@ -217,7 +217,7 @@ void FavouriteTools::on_btnAddFavouriteScript_clicked()
char buffer[MAX_SETTING_SIZE];
memset(buffer, 0, sizeof(buffer));
BridgeSettingGet("Favourite", "LastScriptPath", buffer);
filename = QFileDialog::getOpenFileName(this, tr("Select script"), QString::fromUtf8(buffer), tr("Script files (*.txt *.scr);;All files (*.*)"));
filename = QFileDialog::getOpenFileName(this, tr("Select script"), QString(buffer), tr("Script files (*.txt *.scr);;All files (*.*)"));
if(filename.size() == 0)
return;
filename = QDir::toNativeSeparators(filename);
@ -240,7 +240,7 @@ void FavouriteTools::on_btnEditFavouriteScript_clicked()
char buffer[MAX_SETTING_SIZE];
memset(buffer, 0, sizeof(buffer));
BridgeSettingGet("Favourite", "LastScriptPath", buffer);
filename = QFileDialog::getOpenFileName(this, tr("Select script"), QString::fromUtf8(buffer), tr("Script files (*.txt *.scr);;All files (*.*)"));
filename = QFileDialog::getOpenFileName(this, tr("Select script"), QString(buffer), tr("Script files (*.txt *.scr);;All files (*.*)"));
if(filename.size() == 0)
return;
filename = QDir::toNativeSeparators(filename);

View File

@ -1478,14 +1478,14 @@ void MainWindow::updateFavouriteTools()
ui->menuFavourites->clear();
for(unsigned int i = 1; BridgeSettingGet("Favourite", QString("Tool%1").arg(i).toUtf8().constData(), buffer); i++)
{
QString exePath = QString::fromUtf8(buffer);
QString exePath = QString(buffer);
QAction* newAction = new QAction(this);
newAction->setData(QVariant(QString("Tool,%1").arg(exePath)));
if(BridgeSettingGet("Favourite", QString("ToolShortcut%1").arg(i).toUtf8().constData(), buffer))
if(*buffer && strcmp(buffer, "NOT_SET") != 0)
setGlobalShortcut(newAction, QKeySequence(QString::fromUtf8(buffer)));
setGlobalShortcut(newAction, QKeySequence(QString(buffer)));
if(BridgeSettingGet("Favourite", QString("ToolDescription%1").arg(i).toUtf8().constData(), buffer))
newAction->setText(QString::fromUtf8(buffer));
newAction->setText(QString(buffer));
else
newAction->setText(exePath);
connect(newAction, SIGNAL(triggered()), this, SLOT(clickFavouriteTool()));
@ -1499,14 +1499,14 @@ void MainWindow::updateFavouriteTools()
}
for(unsigned int i = 1; BridgeSettingGet("Favourite", QString("Script%1").arg(i).toUtf8().constData(), buffer); i++)
{
QString scriptPath = QString::fromUtf8(buffer);
QString scriptPath = QString(buffer);
QAction* newAction = new QAction(this);
newAction->setData(QVariant(QString("Script,%1").arg(scriptPath)));
if(BridgeSettingGet("Favourite", QString("ScriptShortcut%1").arg(i).toUtf8().constData(), buffer))
if(*buffer && strcmp(buffer, "NOT_SET") != 0)
setGlobalShortcut(newAction, QKeySequence(QString::fromUtf8(buffer)));
setGlobalShortcut(newAction, QKeySequence(QString(buffer)));
if(BridgeSettingGet("Favourite", QString("ScriptDescription%1").arg(i).toUtf8().constData(), buffer))
newAction->setText(QString::fromUtf8(buffer));
newAction->setText(QString(buffer));
else
newAction->setText(scriptPath);
connect(newAction, SIGNAL(triggered()), this, SLOT(clickFavouriteTool()));
@ -1520,11 +1520,11 @@ void MainWindow::updateFavouriteTools()
}
for(unsigned int i = 1; BridgeSettingGet("Favourite", QString("Command%1").arg(i).toUtf8().constData(), buffer); i++)
{
QAction* newAction = new QAction(QString::fromUtf8(buffer), this);
QAction* newAction = new QAction(QString(buffer), this);
newAction->setData(QVariant(QString("Command")));
if(BridgeSettingGet("Favourite", QString("CommandShortcut%1").arg(i).toUtf8().constData(), buffer))
if(*buffer && strcmp(buffer, "NOT_SET") != 0)
setGlobalShortcut(newAction, QKeySequence(QString::fromUtf8(buffer)));
setGlobalShortcut(newAction, QKeySequence(QString(buffer)));
connect(newAction, SIGNAL(triggered()), this, SLOT(clickFavouriteTool()));
ui->menuFavourites->addAction(newAction);
isanythingexists = true;
@ -1694,13 +1694,13 @@ void MainWindow::setInitialzationScript()
char globalChar[MAX_SETTING_SIZE];
if(DbgIsDebugging())
{
debuggee = QString::fromUtf8(DbgFunctions()->DbgGetDebuggeeInitScript());
debuggee = QString(DbgFunctions()->DbgGetDebuggeeInitScript());
BrowseDialog browseScript(this, tr("Set Initialzation Script for Debuggee"), tr("Set Initialzation Script for Debuggee"), tr("Script files (*.txt *.scr);;All files (*.*)"), debuggee, false);
if(browseScript.exec() == QDialog::Accepted)
DbgFunctions()->DbgSetDebuggeeInitScript(browseScript.path.toUtf8().constData());
}
if(BridgeSettingGet("Engine", "InitializeScript", globalChar))
global = QString::fromUtf8(globalChar);
global = QString(globalChar);
else
global = QString();
BrowseDialog browseScript(this, tr("Set Global Initialzation Script"), tr("Set Global Initialzation Script"), tr("Script files (*.txt *.scr);;All files (*.*)"), global, false);

View File

@ -313,7 +313,7 @@ void MemoryMapView::refreshMap()
setCellContent(wI, 1, wS);
// Information
wS = QString::fromUtf8((wMemMapStruct.page)[wI].info);
wS = QString((wMemMapStruct.page)[wI].info);
setCellContent(wI, 2, wS);
// State

View File

@ -238,7 +238,7 @@ void SettingsDialog::LoadSettings()
}
char setting[MAX_SETTING_SIZE] = "";
if(BridgeSettingGet("Symbols", "DefaultStore", setting))
ui->editSymbolStore->setText(QString::fromUtf8(setting));
ui->editSymbolStore->setText(QString(setting));
else
{
QString defaultStore("http://msdl.microsoft.com/download/symbols");
@ -246,9 +246,9 @@ void SettingsDialog::LoadSettings()
BridgeSettingSet("Symbols", "DefaultStore", defaultStore.toUtf8().constData());
}
if(BridgeSettingGet("Symbols", "CachePath", setting))
ui->editSymbolCache->setText(QString::fromUtf8(setting));
ui->editSymbolCache->setText(QString(setting));
if(BridgeSettingGet("Misc", "HelpOnSymbolicNameUrl", setting))
ui->editHelpOnSymbolicNameUrl->setText(QString::fromUtf8(setting));
ui->editHelpOnSymbolicNameUrl->setText(QString(setting));
bJitOld = settings.miscSetJIT;
bJitAutoOld = settings.miscSetJITAuto;

View File

@ -404,7 +404,7 @@ void SymbolView::moduleBrowse()
char szModPath[MAX_PATH] = "";
if(DbgFunctions()->ModPathFromAddr(modbase, szModPath, _countof(szModPath)))
{
QProcess::startDetached("explorer.exe", QStringList(QString("/select,").append(QString::fromUtf8(szModPath))));
QProcess::startDetached("explorer.exe", QStringList(QString("/select,").append(QString(szModPath))));
}
}

View File

@ -33,8 +33,8 @@ void WatchView::updateWatch()
setRowCount(WatchList.Count());
for(int i = 0; i < WatchList.Count(); i++)
{
setCellContent(i, 0, QString::fromUtf8(WatchList[i].WatchName));
setCellContent(i, 1, QString::fromUtf8(WatchList[i].Expression));
setCellContent(i, 0, QString(WatchList[i].WatchName));
setCellContent(i, 1, QString(WatchList[i].Expression));
switch(WatchList[i].varType)
{
case WATCHVARTYPE::TYPE_UINT:

View File

@ -72,7 +72,7 @@ void Breakpoints::enableBP(const BRIDGEBP & bp)
}
else if(bp.type == bp_dll)
{
wCmd = QString("LibrarianEnableBreakPoint \"%1\"").arg(QString::fromUtf8(bp.mod));
wCmd = QString("LibrarianEnableBreakPoint \"%1\"").arg(QString(bp.mod));
}
@ -134,7 +134,7 @@ void Breakpoints::disableBP(const BRIDGEBP & bp)
}
else if(bp.type == bp_dll)
{
wCmd = QString("LibrarianDisableBreakPoint \"%1\"").arg(QString::fromUtf8(bp.mod));
wCmd = QString("LibrarianDisableBreakPoint \"%1\"").arg(QString(bp.mod));
}
DbgCmdExec(wCmd.toUtf8().constData());
@ -196,7 +196,7 @@ void Breakpoints::removeBP(const BRIDGEBP & bp)
break;
case bp_dll:
wCmd = QString("bcdll \"%1\"").arg(QString::fromUtf8(bp.mod));
wCmd = QString("bcdll \"%1\"").arg(QString(bp.mod));
break;
default:
@ -249,7 +249,7 @@ void Breakpoints::removeBP(const QString & DLLName)
// Find breakpoint at DLLName
for(int wI = 0; wI < wBPList.count; wI++)
{
if(QString::fromUtf8(wBPList.bp[wI].mod) == DLLName)
if(QString(wBPList.bp[wI].mod) == DLLName)
{
removeBP(wBPList.bp[wI]);
}
@ -315,7 +315,7 @@ void Breakpoints::toggleBPByDisabling(const QString & DLLName)
// Find breakpoint at module name
for(int wI = 0; wI < wBPList.count; wI++)
{
if(QString::fromUtf8(wBPList.bp[wI].mod) == DLLName)
if(QString(wBPList.bp[wI].mod) == DLLName)
{
toggleBPByDisabling(wBPList.bp[wI]);
}