Skip to content

Commit

Permalink
Ported from Qt4 to Qt5
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Nov 14, 2013
1 parent 39244ed commit 2a17826
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 21 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PROJECT( yast2-control-center )
CMAKE_MINIMUM_REQUIRED( VERSION 2.6.0 )
FIND_PACKAGE( Qt4 REQUIRED )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.9 )
FIND_PACKAGE( Qt5Core REQUIRED )

SET( RPMNAME "yast2-control-center" )

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-control-center.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Source0: yast2-control-center-%{version}.tar.bz2
BuildRequires: cmake
BuildRequires: libdrm-devel
BuildRequires: libjpeg-devel
BuildRequires: libqt4-devel
BuildRequires: libqt5-qtbase-devel
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: yast2-devtools
Expand Down
12 changes: 3 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
INCLUDE(${QT_USE_FILE})

INCLUDE_DIRECTORIES(/usr/include/initng ${CMAKE_CURRENT_BINARY_DIR})

SET(THEMEDIR "/usr/share/YaST2/theme")
Expand Down Expand Up @@ -53,14 +51,10 @@ SET(yast2-control-center_HDRS
#SET(yast2-control-center_RCCS ../files.qrc)


QT4_AUTOMOC(${yast2-control-center_SRCS})
# QT4_WRAP_UI(yast2-control-center_UIS_H ${yast2-control-center_UIS})
QT4_WRAP_CPP(yast2-control-center_MOC ${yast2-control-center_UIS_H})
QT4_ADD_RESOURCES(yast2-control-center_RCC_SRCS ${yast2-control-center_RCCS})


SET(CMAKE_AUTOMOC ON)

ADD_EXECUTABLE(y2controlcenter ${yast2-control-center_SRCS} ${yast2-control-center_MOC} ${yast2-control-center_RCC_SRCS})
QT5_USE_MODULES(y2controlcenter Widgets Gui)
TARGET_LINK_LIBRARIES(y2controlcenter ${QT_LIBRARIES})
INSTALL(TARGETS y2controlcenter DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/YaST2/bin)

Expand All @@ -76,8 +70,8 @@ SET(MODELS_TEST_SRCS
yqmodulesmodel.cpp )


QT4_AUTOMOC(${MODELS_TEST_SRCS})
ADD_EXECUTABLE(models_test ${MODELS_TEST_SRCS})
QT5_USE_MODULES(models_test Widgets Gui)
TARGET_LINK_LIBRARIES(models_test ${QT_QTCORE_LIBRARIES} ${QT_QTGUI_LIBRARIES})

FIND_PACKAGE(KDE4)
Expand Down
2 changes: 1 addition & 1 deletion src/kcategorizedsortfilterproxymodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef KCATEGORIZEDSORTFILTERPROXYMODEL_H
#define KCATEGORIZEDSORTFILTERPROXYMODEL_H

#include <QtGui/QSortFilterProxyModel>
#include <QSortFilterProxyModel>

//#include "kdeui_export.h"

Expand Down
2 changes: 1 addition & 1 deletion src/kcategorizedview.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef KCATEGORIZEDVIEW_H
#define KCATEGORIZEDVIEW_H

#include <QtGui/QListView>
#include <QListView>

//#include <kdeui_export.h>
#define KDEUI_EXPORT
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int main(int argc, char **argv)
noborder = true;
}

Qt::WFlags wflags = Qt::Window;
Qt::WindowFlags wflags = Qt::Window;

if ( noborder )
wflags |= Qt::FramelessWindowHint;
Expand Down
4 changes: 2 additions & 2 deletions src/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,13 @@ void MainWindow::slotLaunchModule( const QModelIndex &index)

QApplication::setOverrideCursor(Qt::WaitCursor);

qDebug() << "Run command: " << cmd.toAscii();
qDebug() << "Run command: " << cmd.toUtf8();
std::cout << "Run command: " << qPrintable(cmd) << std::endl;
//Translators: module name comes here (%1) e.g. HTTP server, Scanner,...
QString msg = _("Starting configuration module \"%1\"...").arg( name );
statusBar()->showMessage( msg, 2000 );

system( cmd.toAscii() );
system( cmd.toUtf8() );

QTimer::singleShot( 3*1000, this, SLOT( slotRestoreCursor() ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/yqdesktopfilesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ QVariant YQDesktopFilesModel::translatedPropertyValue( const QModelIndex &index,
msgid += ": ";
msgid += valueAsString;

QString msgstr = QString::fromUtf8( dgettext ( DESKTOP_TRANSLATIONS, msgid.toAscii()) );
QString msgstr = QString::fromUtf8( dgettext ( DESKTOP_TRANSLATIONS, msgid.toUtf8()) );

if( msgid == msgstr)
return valueAsString;
Expand Down
6 changes: 3 additions & 3 deletions src/yqsavelogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void YQSaveLogs::SaveLogs()
QString saveLogsCommand = "/sbin/save_y2logs";
QStringList args = QStringList() << fileName;

if ( access( saveLogsCommand.toAscii(), X_OK ) == 0 )
if ( access( saveLogsCommand.toUtf8(), X_OK ) == 0 )
{
lock = true;

Expand Down Expand Up @@ -170,11 +170,11 @@ QString YQSaveLogs::askForSaveFileName( const QString & startWith,
return QString::null;


if ( access( file_name.toAscii(), F_OK ) == 0 ) // file exists?
if ( access( file_name.toUtf8(), F_OK ) == 0 ) // file exists?
{
QString msg;

if ( access( file_name.toAscii(), W_OK ) == 0 )
if ( access( file_name.toUtf8(), W_OK ) == 0 )
{
// Confirm if the user wishes to overwrite an existing file
msg = ( _( "%1 exists! Really overwrite?" ) ).arg( file_name );
Expand Down

0 comments on commit 2a17826

Please sign in to comment.