Porting kwin main, data and compositingprefs to Qt5/KF5: QStandardPaths

REVIEW: 111971
master
Anselmo L. S. Melo 11 years ago
parent 9c225200bf
commit c9b079e628

@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KDE/KLocalizedString> #include <KDE/KLocalizedString>
#include <kdeversion.h> #include <kdeversion.h>
#include <ksharedconfig.h> #include <ksharedconfig.h>
#include <kstandarddirs.h>
#include <QStandardPaths>
#include <qprocess.h> #include <qprocess.h>
@ -148,7 +148,7 @@ void CompositingPrefs::detect()
// environment variable. // environment variable.
// Direct rendering is preferred, since not all OpenGL extensions are // Direct rendering is preferred, since not all OpenGL extensions are
// available with indirect rendering. // available with indirect rendering.
const QString opengl_test = KStandardDirs::findExe(QStringLiteral("kwin_opengl_test")); const QString opengl_test = QStandardPaths::findExecutable(QStringLiteral("kwin_opengl_test"));
if (QProcess::execute(opengl_test) != 0) { if (QProcess::execute(opengl_test) != 0) {
mEnableDirectRendering = false; mEnableDirectRendering = false;
setenv("LIBGL_ALWAYS_INDIRECT", "1", true); setenv("LIBGL_ALWAYS_INDIRECT", "1", true);

@ -24,11 +24,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <kdebug.h> #include <kdebug.h>
#include <kcomponentdata.h> #include <kcomponentdata.h>
#include <kstandarddirs.h>
#include <kaboutdata.h> #include <kaboutdata.h>
#include <kcmdlineargs.h> #include <kcmdlineargs.h>
#include <kglobal.h> #include <kglobal.h>
#include <QtDBus/QtDBus> #include <QtDBus/QtDBus>
#include <QtCore/QStandardPaths>
int main( int argc, char* argv[] ) int main( int argc, char* argv[] )
{ {
@ -38,7 +38,7 @@ int main( int argc, char* argv[] )
KCmdLineArgs::init( argc, argv, &about ); KCmdLineArgs::init( argc, argv, &about );
KComponentData inst( &about ); KComponentData inst( &about );
Q_UNUSED( KGlobal::locale() ); // jump-start locales to get to translated descriptions Q_UNUSED( KGlobal::locale() ); // jump-start locales to get to translated descriptions
QString file = KStandardDirs::locate( "data", QString( "kwin/default_rules/%1" ).arg(argv[ 1 ] )); QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString( "kwin/default_rules/%1" ).arg(argv[ 1 ] ));
if( file.isEmpty()) if( file.isEmpty())
{ {
kWarning(1212) << "File " << argv[ 1 ] << " not found!" ; kWarning(1212) << "File " << argv[ 1 ] << " not found!" ;

@ -42,7 +42,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QEvent> #include <QEvent>
#include <kdialog.h> #include <kdialog.h>
#include <kstandarddirs.h> #include <QStandardPaths>
#include <kdebug.h> #include <kdebug.h>
#include <kde_file.h> #include <kde_file.h>
#include <QLabel> #include <QLabel>
@ -179,7 +179,7 @@ public:
void addWM(const QString& wm) { void addWM(const QString& wm) {
// TODO: Check if WM is installed // TODO: Check if WM is installed
if (!KStandardDirs::findExe(wm).isEmpty()) if (!QStandardPaths::findExecutable(wm).isEmpty())
wmList->addItem(wm); wmList->addItem(wm);
} }
QString selectedWM() const { QString selectedWM() const {

Loading…
Cancel
Save