14
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
#include <QApplication>
17
#include "fcitxcfgwizard.h" //kobe08
17
#include "fcitxcfgwizard.h"
18
19
#include "systemdispatcher.h"
19
20
#include "sessiondispatcher.h"
21
#include "sudodispatcher.h"
20
22
#include "youker-application.h"
21
23
#include <QDeclarativeEngine>
22
24
#include <QDeclarativeView>
23
25
#include <QtDeclarative>
25
26
#include "qmlaudio.h"
26
27
#include <QTextCodec>
27
28
#include <QProcess>
30
30
#include <sys/types.h>
37
31
#include "qrangemodel.h"
38
32
#include "qstyleitem.h"
39
33
#include "qwheelarea.h"
56
50
#include <qdeclarativeitem.h>
57
51
#include <qdeclarativeimageprovider.h>
58
52
#include <qdeclarativeview.h>
62
53
#include "KThread.h"
67
d DOUBLE IEEE 754双精度浮点数
76
v VARIANT 可以放任意数据类型的容器,数据中包含类型信息。例如glib中的GValue。
79
() 定义结构时使用。例如"(i(ii))"
80
{} 定义键-值对时使用。例如"a{us}"
82
a表示数组,数组元素的类型由a后面的标记决定。例如:
84
数组"a(i(ii))"的元素是一个结构。用括号将成员的类型括起来就表示结构了,结构可以嵌套。
85
数组"a{sv}"的元素是一个键-值对。"{sv}"表示键类型是字符串,值类型是VARIANT。
56
void registerTypes() {
57
qmlRegisterType<Toolkits>("ToolkitsType", 0, 1, "Toolkits");
91
58
qmlRegisterType<SessionDispatcher>("SessionType", 0, 1, "SessionDispatcher");
92
59
qmlRegisterType<SystemDispatcher>("SystemType", 0, 1, "SystemDispatcher");
93
qmlRegisterType<FcitxCfgWizard>("FcitxCfgWizard", 0, 1, "FcitxCfgWizard");//kobe08
60
qmlRegisterType<SudoDispatcher>("SudoType", 0, 1, "SudoDispatcher");
61
qmlRegisterType<FcitxCfgWizard>("FcitxCfgWizard", 0, 1, "FcitxCfgWizard");
94
62
qmlRegisterType<QmlAudio>("AudioType", 0, 1, "QmlAudio");
95
63
qmlRegisterType<QRangeModel>("RangeModelType", 0, 1, "RangeModel");
96
64
qmlRegisterType<QStyleItem>("StyleItemType", 0, 1, "StyleItem");
97
65
qmlRegisterType<QWheelArea>("WheelAreaType", 0, 1, "WheelArea");
98
66
qmlRegisterType<QtMenu>("MenuType", 0, 1, "Menu");
99
67
qmlRegisterUncreatableType<QtMenuBase>("MenuBaseType", 0, 1, "NativeMenuBase", QLatin1String("Do not create objects of type NativeMenuBase"));
101
68
qmlRegisterType<QCursorArea>("CursorAreaType", 0, 1, "CursorArea");
102
69
qmlRegisterType<QTooltipArea>("TooltipAreaType", 0, 1, "TooltipArea");
103
70
qmlRegisterType<QtMenuBar>("MenuBarType", 0, 1, "MenuBar");
112
79
qmlRegisterUncreatableType<QDeclarativeLayout>("LayoutType", 0, 1, "Layout",
113
80
QLatin1String("Do not create objects of type Layout"));
114
81
qmlRegisterUncreatableType<QDesktopItem>("DesktopType",0,1,"Desktop", QLatin1String("Do not create objects of type Desktop"));
119
84
int main(int argc, char** argv)
87
QProcess *process = new QProcess();
88
QStringList *args = new QStringList();
90
process->start("ps", *args);
91
process->waitForFinished();
92
while(process->canReadLine()) {
93
QString tmp = process->readLine();
94
if(tmp.endsWith("youker-assistant\n")) {
121
101
QTextCodec::setCodecForTr(QTextCodec::codecForLocale());
122
102
QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
123
103
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));