Skip to content

Commit

Permalink
Changes needed for Qt5 - big kudos to Kiwii from AUR :)
Browse files Browse the repository at this point in the history
- QApplication & QLabel moved to QtWidgets
- Remove setting text codec (hoping it just defaults to UTF-8 now)
- Replace qInstallMsgHandler with InstallMessageHandler
  • Loading branch information
Daniel Maslowski committed Jul 2, 2017
1 parent 882a8cf commit 5e1bbd9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/configwindow.cpp
Expand Up @@ -63,10 +63,10 @@ const std::unordered_map<QString, const QVariant> ConfigWindow::config_defaults
static DebugWindow* log_class = nullptr;
static bool debug = false;

void handle_message(QtMsgType type, const char *msg)
void handle_message(QtMsgType type, const QMessageLogContext &, const QString & str)
{
if(log_class && debug){
log_class->handle_message(type,msg);
log_class->handle_message(type,str.toStdString().c_str());
}
}

Expand All @@ -80,7 +80,7 @@ ConfigWindow::ConfigWindow(QWidget *parent) :
ui_debug = std::unique_ptr<DebugWindow>(new DebugWindow());
log_class = ui_debug.get();

qInstallMsgHandler(handle_message);
qInstallMessageHandler(handle_message);

#ifndef Q_WS_X11
// Do not show X11 specific options on other platforms
Expand Down
2 changes: 1 addition & 1 deletion src/effect.h
Expand Up @@ -21,7 +21,7 @@
#define EFFECT_H

#include <QtGui/QMovie>
#include <QtGui/QLabel>
#include <QtWidgets/QLabel>
#include <QMainWindow>
#include <QVariant>
#include <QMovie>
Expand Down
4 changes: 1 addition & 3 deletions src/main.cpp
Expand Up @@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <QtGui/QApplication>
#include <QtWidgets/QApplication>
#include <QtCore/QLocale>
#include <QTranslator>
#include <QDebug>
Expand Down Expand Up @@ -54,8 +54,6 @@ int main(int argc, char *argv[])
app.installTranslator(&translator);

app.setQuitOnLastWindowClosed(false);
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QSettings::setDefaultFormat(QSettings::IniFormat);

if ( app.isRunning() ) {
Expand Down
2 changes: 1 addition & 1 deletion src/pony.h
Expand Up @@ -21,7 +21,7 @@
#define PONY_H

#include <QtGui/QMovie>
#include <QtGui/QLabel>
#include <QtWidgets/QLabel>
#include <QMainWindow>
#include <QMouseEvent>
#include <QHash>
Expand Down

0 comments on commit 5e1bbd9

Please sign in to comment.