[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [systemsettings/sebas/quick] quick: Remove copy of kuserproxy
From:       Sebastian_Kügler <sebas () kde ! org>
Date:       2014-07-31 16:51:29
Message-ID: E1XCtZh-00088D-FY () scm ! kde ! org
[Download RAW message or body]

Git commit 0c7c828c73fb9f498a94b00620c753f505608521 by Sebastian Kügler.
Committed on 22/07/2014 at 00:02.
Pushed by sebas into branch 'sebas/quick'.

Remove copy of kuserproxy

This will have to move elsewhere, let's try kdeclarative/[...]/kcoreaddons.

M  +0    -1    quick/CMakeLists.txt
M  +0    -2    quick/QuickMode.cpp
M  +1    -1    quick/breeze/contents/ui/MainView.qml
D  +0    -101  quick/kuserproxy.cpp
D  +0    -53   quick/kuserproxy.h

http://commits.kde.org/systemsettings/0c7c828c73fb9f498a94b00620c753f505608521

diff --git a/quick/CMakeLists.txt b/quick/CMakeLists.txt
index d3f0bc3..c675c5b 100644
--- a/quick/CMakeLists.txt
+++ b/quick/CMakeLists.txt
@@ -2,7 +2,6 @@
 set(quick_mode_srcs
     Category.cpp
     host.cpp
-    kuserproxy.cpp
     QuickMode.cpp
 )
 
diff --git a/quick/QuickMode.cpp b/quick/QuickMode.cpp
index 86dff34..fc9c961 100644
--- a/quick/QuickMode.cpp
+++ b/quick/QuickMode.cpp
@@ -23,7 +23,6 @@
 #include "QuickMode.h"
 #include "Category.h"
 #include "host.h"
-#include "kuserproxy.h"
 #include "ui_configClassic.h"
 
 #include <QDebug>
@@ -148,7 +147,6 @@ void QuickMode::initEvent()
 
     // Register Category* in the QML runtime
     qmlRegisterUncreatableType<Category>("org.kde.systemsettings", 5, 0, "Category", \
                "You cannot create Category objects.");
-    qmlRegisterType<KUserProxy>("org.kde.systemsettings", 5, 0, "KUser");
 }
 
 QWidget *QuickMode::mainWidget()
diff --git a/quick/breeze/contents/ui/MainView.qml \
b/quick/breeze/contents/ui/MainView.qml index dd9b4b4..e63b64c 100644
--- a/quick/breeze/contents/ui/MainView.qml
+++ b/quick/breeze/contents/ui/MainView.qml
@@ -1,5 +1,5 @@
 /*
- *   Copyright 2014 Sebastian Kügler <sebas@kde.org>
+ *   Copyright 2014 Sebastian K�gler <sebas@kde.org>
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU Library General Public License as
diff --git a/quick/kuserproxy.cpp b/quick/kuserproxy.cpp
deleted file mode 100644
index 422e550..0000000
--- a/quick/kuserproxy.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/***************************************************************************
- *   Copyright 2013 Marco Martin <mart@kde.org>                            *
- *   Copyright 2014 Sebastian Kugler <sebas@kde.org>                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#include <unistd.h>
-
-#include "kuserproxy.h"
-#include <QFile>
-#include <QTextStream>
-#include <QUrl>
-
-//#include <KLocalizedString>
-
-#include <QDebug>
-
-KUserProxy::KUserProxy (QObject *parent)
-    : QObject(parent)
-{
-}
-
-KUserProxy::~KUserProxy()
-{
-}
-
-QString KUserProxy::fullName() const
-{
-    return m_user.property(KUser::FullName).toString();
-}
-
-QString KUserProxy::loginName() const
-{
-    return m_user.loginName();
-}
-
-QString KUserProxy::faceIconPath() const
-{
-    const QString u = m_user.faceIconPath();
-    const QFile f(u);
-    if (f.exists(u)) {
-        // We need to return a file URL, not a simple path
-        return QUrl::fromLocalFile(u).toString();
-    }
-    return QString();
-}
-
-QString KUserProxy::os()
-{
-    if (m_os.isEmpty()) {
-        //m_os = i18n("Plasma by KDE");
-        QFile osfile("/etc/os-release");
-        if (osfile.exists()) {
-            if (!osfile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-                return QString();
-            }
-
-            QTextStream in(&osfile);
-            while(!in.atEnd()) {
-                QString line = in.readLine();
-                if (line.startsWith("PRETTY_NAME")) {
-                    QStringList fields = line.split("PRETTY_NAME=\"");
-                    if (fields.count() == 2) {
-                        osfile.close();
-                        QString pretty = fields.at(1);
-                        pretty.chop(1);
-                        m_os = pretty;
-                        return pretty;
-                    }
-                }
-            }
-            osfile.close();
-        }
-    }
-    return m_os;
-}
-
-QString KUserProxy::host() const
-{
-    char hostname[256];
-    hostname[0] = '\0';
-    if (!gethostname(hostname, sizeof(hostname))) {
-        hostname[sizeof(hostname)-1] = '\0';
-    }
-    return QString(hostname);
-}
-
diff --git a/quick/kuserproxy.h b/quick/kuserproxy.h
deleted file mode 100644
index a5b8b6c..0000000
--- a/quick/kuserproxy.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- *   Copyright 2014 Sebastian K�gler <sebas@kde.org>                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#ifndef KUSERPROXY_H
-#define KUSERPROXY_H
-
-#include <QObject>
-
-#include <KUser>
-
-class KUserProxy : public QObject
-{
-    Q_OBJECT
-
-    Q_PROPERTY(QString fullName READ fullName CONSTANT)
-    Q_PROPERTY(QString loginName READ loginName CONSTANT)
-    Q_PROPERTY(QString faceIconPath READ faceIconPath CONSTANT)
-    Q_PROPERTY(QString os READ os CONSTANT)
-    Q_PROPERTY(QString host READ host CONSTANT)
-
-public:
-    KUserProxy(QObject *parent = 0);
-    ~KUserProxy();
-
-    QString fullName() const;
-    QString loginName() const;
-    QString faceIconPath() const;
-    QString os();
-    QString host() const;
-
-private:
-    KUser m_user;
-    QString m_os;
-};
-
-#endif //KUSERPROXY_H
-


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic