forked from openkylin/ukui-search
Merge pull request #228 from sunfengsheng/main
fix:Night mode can be search in huawei
This commit is contained in:
commit
f07f9085bf
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
#include "setting-match.h"
|
#include "setting-match.h"
|
||||||
#include "file-utils.h"
|
#include "file-utils.h"
|
||||||
|
#include <QProcessEnvironment>
|
||||||
using namespace Zeeker;
|
using namespace Zeeker;
|
||||||
SettingsMatch::SettingsMatch(QObject *parent) : QObject(parent) {
|
SettingsMatch::SettingsMatch(QObject *parent) : QObject(parent) {
|
||||||
xmlElement();
|
xmlElement();
|
||||||
|
@ -44,6 +45,8 @@ QStringList SettingsMatch::startMatchApp(const QString &source) {
|
||||||
void SettingsMatch::xmlElement() {
|
void SettingsMatch::xmlElement() {
|
||||||
QString ChineseIndex;
|
QString ChineseIndex;
|
||||||
QString EnglishIndex;
|
QString EnglishIndex;
|
||||||
|
QString path = QProcessEnvironment::systemEnvironment().value("XDG_SESSION_TYPE");
|
||||||
|
QString version;
|
||||||
QFile file(QString::fromLocal8Bit("/usr/share/ukui-control-center/shell/res/search.xml"));
|
QFile file(QString::fromLocal8Bit("/usr/share/ukui-control-center/shell/res/search.xml"));
|
||||||
if(!file.open(QIODevice::ReadOnly)) {
|
if(!file.open(QIODevice::ReadOnly)) {
|
||||||
return;
|
return;
|
||||||
|
@ -62,6 +65,12 @@ void SettingsMatch::xmlElement() {
|
||||||
QDomNodeList list = element.childNodes();
|
QDomNodeList list = element.childNodes();
|
||||||
for(int i = 0; i < list.count(); ++i) {
|
for(int i = 0; i < list.count(); ++i) {
|
||||||
QDomNode n = list.at(i);
|
QDomNode n = list.at(i);
|
||||||
|
if(n.nodeName()==QString::fromLocal8Bit("Environment")){
|
||||||
|
version=n.toElement().text();
|
||||||
|
if((version=="v101"&&path=="wayland")||(version=="hw990"&&path=="x11")){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(n.nodeName() == QString::fromLocal8Bit("ChinesePlugin")) {
|
if(n.nodeName() == QString::fromLocal8Bit("ChinesePlugin")) {
|
||||||
ChineseIndex = n.toElement().text();
|
ChineseIndex = n.toElement().text();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue