Avoid a char * for a constant string.

This commit is contained in:
Unknown W. Brackets 2014-02-15 01:47:14 -08:00
parent dda1f212f0
commit 2459f4e351
3 changed files with 8 additions and 8 deletions

View File

@ -153,7 +153,7 @@ class MenuAction : public QAction
public: public:
// Add to QMenu // Add to QMenu
MenuAction(QWidget* parent, const char* callback, char* text, QKeySequence key = 0) : MenuAction(QWidget* parent, const char *callback, const char *text, QKeySequence key = 0) :
QAction(parent), _text(text), _eventCheck(0), _stateEnable(-1), _stateDisable(-1), _enableStepping(false) QAction(parent), _text(text), _eventCheck(0), _stateEnable(-1), _stateDisable(-1), _enableStepping(false)
{ {
if (key != (QKeySequence)0) { if (key != (QKeySequence)0) {
@ -213,8 +213,8 @@ public slots:
setEnabled(true); setEnabled(true);
} }
private: private:
char* _text; const char *_text;
bool* _eventCheck; bool *_eventCheck;
int _stateEnable, _stateDisable; int _stateEnable, _stateDisable;
bool _enableStepping; bool _enableStepping;
}; };
@ -241,13 +241,13 @@ class MenuTree : public QMenu
{ {
Q_OBJECT Q_OBJECT
public: public:
MenuTree(QWidget* parent, QMenuBar* menu, char* text) : MenuTree(QWidget* parent, QMenuBar* menu, const char *text) :
QMenu(parent), _text(text) QMenu(parent), _text(text)
{ {
menu->addMenu(this); menu->addMenu(this);
connect(parent, SIGNAL(retranslate()), this, SLOT(retranslate())); connect(parent, SIGNAL(retranslate()), this, SLOT(retranslate()));
} }
MenuTree(QWidget* parent, QMenu* menu, char* text) : MenuTree(QWidget* parent, QMenu* menu, const char *text) :
QMenu(parent), _text(text) QMenu(parent), _text(text)
{ {
menu->addMenu(this); menu->addMenu(this);
@ -263,7 +263,7 @@ public slots:
setTitle(qApp->translate("MainWindow", _text)); setTitle(qApp->translate("MainWindow", _text));
} }
private: private:
char* _text; const char *_text;
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

View File

@ -182,7 +182,7 @@ void EnableCrashingOnCrashes()
} }
} }
bool System_InputBoxGetString(char *title, const char *defaultValue, char *outValue, size_t outLength) bool System_InputBoxGetString(const char *title, const char *defaultValue, char *outValue, size_t outLength)
{ {
std::string out; std::string out;
if (InputBox_GetString(MainWindow::GetHInstance(), MainWindow::GetHWND(), ConvertUTF8ToWString(title).c_str(), defaultValue, out)) { if (InputBox_GetString(MainWindow::GetHInstance(), MainWindow::GetHWND(), ConvertUTF8ToWString(title).c_str(), defaultValue, out)) {

2
native

@ -1 +1 @@
Subproject commit 263e2207be4a281c7991419bff2c69224d8a4288 Subproject commit 36a9bafcaf90b962480c1ce12155f313ba101cc9