diff --git a/src/input-box.cpp b/src/input-box.cpp index 1d3fcba..0b57c19 100644 --- a/src/input-box.cpp +++ b/src/input-box.cpp @@ -235,9 +235,9 @@ SearchLineEdit::SearchLineEdit(QWidget *parent) : QLineEdit(parent) { // this->addAction(searchAction,QLineEdit::LeadingPosition); /*发送输入框文字改变的dbus*/ - QDBusConnection::sessionBus().unregisterService("org.ukui.search.service"); - QDBusConnection::sessionBus().registerService("org.ukui.search.service"); - QDBusConnection::sessionBus().registerObject("/lineEdit/textChanged", this, QDBusConnection :: ExportAllSlots | QDBusConnection :: ExportAllSignals); +// QDBusConnection::sessionBus().unregisterService("org.ukui.search.service"); +// QDBusConnection::sessionBus().registerService("org.ukui.search.service"); +// QDBusConnection::sessionBus().registerObject("/lineEdit/textChanged", this, QDBusConnection :: ExportAllSlots | QDBusConnection :: ExportAllSignals); connect(this, &QLineEdit::textChanged, this, &SearchLineEdit::lineEditTextChanged); connect(this, &QLineEdit::textChanged, this, [ = ]() { diff --git a/src/input-box.h b/src/input-box.h index d17db8c..61e4973 100644 --- a/src/input-box.h +++ b/src/input-box.h @@ -94,11 +94,11 @@ private: class SearchLineEdit : public QLineEdit { Q_OBJECT - /* - * 负责与ukui桌面环境应用通信的dbus - * 搜索框文本改变的时候发送信号 -    */ - Q_CLASSINFO("D-Bus Interface", "org.ukui.search.inputbox") +// /* +// * 负责与ukui桌面环境应用通信的dbus +// * 搜索框文本改变的时候发送信号 +//    */ +// Q_CLASSINFO("D-Bus Interface", "org.ukui.search.inputbox") public: SearchLineEdit(QWidget *parent = nullptr); void record(); diff --git a/src/ukui-search-dbus-service.cpp b/src/ukui-search-dbus-service.cpp index 5ca1981..c0955af 100644 --- a/src/ukui-search-dbus-service.cpp +++ b/src/ukui-search-dbus-service.cpp @@ -10,7 +10,8 @@ UkuiSearchDbusServices::UkuiSearchDbusServices(MainWindow *m) m_mainWindow = m; //注册服务 QDBusConnection sessionBus = QDBusConnection::sessionBus(); - if(!sessionBus.registerService("org.ukui.search.service")){ + QDBusConnection::sessionBus().unregisterService("com.ukui.search.service"); + if(!sessionBus.registerService("com.ukui.search.service")){ qWarning() << "ukui-search dbus register service failed reason:" << sessionBus.lastError(); }