Project

General

Profile

quassel-solid-networking-reconnect.diff

sebas, 05/23/2009 12:58 AM

Download (2.36 KB)

View differences:

CMakeLists.txt
198 198
    add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS})
199 199
    set(HAVE_KDE 1)
200 200
    set(MOC_DEFINES ${MOC_DEFINES} -DHAVE_KDE)
201
    set(QUASSEL_KDE_LIBRARIES ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY} knotifyconfig)
201
    set(QUASSEL_KDE_LIBRARIES ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY} ${KDE4_SOLID_LIBS} knotifyconfig)
202 202
    # We always use external icons for KDE4 support, since we use its iconloader rather than our own
203 203
    set(EMBED_DATA OFF)
204 204
  else(KDE4_FOUND)
src/qtui/mainwin.cpp
151 151
           SLOT(messagesInserted(const QModelIndex &, int, int)));
152 152
  connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId)));
153 153

  
154
#ifdef HAVE_KDE
155
  connect(Solid::Networking::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)),
156
           SLOT(networkStatusChanged(Solid::Networking::Status)));
157
#endif
154 158
  // Setup Dock Areas
155 159
  setDockNestingEnabled(true);
156 160
  setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
......
1027 1031
  statusBar()->showMessage(message, 10000);
1028 1032
}
1029 1033

  
1034
#ifdef HAVE_KDE
1035
void MainWin::networkStatusChanged(Solid::Networking::Status status) {
1036

  
1037
  if (status == Solid::Networking::Connected || status == Solid::Networking::Unknown) {
1038
    qDebug() << "network status changed to connected or unknown" << Solid::Networking::Connected << status;
1039
    showCoreConnectionDlg(true);
1040
  } else {
1041
    qDebug() << "Disconnected or whatever" << status;
1042
    emit disconnectFromCore();
1043
  }
1044
}
1045
#endif
1046

  
src/qtui/mainwin.h
23 23

  
24 24
#ifdef HAVE_KDE
25 25
#  include <KMainWindow>
26
#  include <Solid/Networking>
26 27
#else
27 28
#  include <QMainWindow>
28 29
#endif
......
115 116
    void showNotificationsDlg();
116 117
#ifdef HAVE_KDE
117 118
    void showShortcutsDlg();
119
    void networkStatusChanged(Solid::Networking::Status status);
118 120
#endif
119 121
    void on_actionConfigureNetworks_triggered();
120 122
    void on_actionConfigureViews_triggered();