Project

General

Profile

quassel-solid-networking-reconnect-fix.diff

bbigras, 06/27/2009 09:25 AM

Download (2.43 KB)

View differences:

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

  
149
#ifdef HAVE_KDE
150
  connect(Solid::Networking::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)),
151
           SLOT(networkStatusChanged(Solid::Networking::Status)));
152
#endif
149 153
  // Setup Dock Areas
150 154
  setDockNestingEnabled(true);
151 155
  setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
......
1073 1077
  statusBar()->showMessage(message, 10000);
1074 1078
}
1075 1079

  
1080
#ifdef HAVE_KDE
1081
void MainWin::networkStatusChanged(Solid::Networking::Status status) {
1082
  if(Quassel::runMode() != Quassel::Monolithic) {
1083
    if (status == Solid::Networking::Connected || status == Solid::Networking::Unknown) {
1084
      qDebug() << "network status changed to connected or unknown" << Solid::Networking::Connected << status;
1085
      showCoreConnectionDlg(true);
1086
    } else {
1087
      qDebug() << "Disconnected or whatever" << status;
1088
      emit disconnectFromCore();
1089
    }
1090
  }
1091
}
1092
#endif
1093

  
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
......
119 120
    void showNotificationsDlg();
120 121
#ifdef HAVE_KDE
121 122
    void showShortcutsDlg();
123
    void networkStatusChanged(Solid::Networking::Status status);
122 124
#endif
123 125
    void on_actionConfigureNetworks_triggered();
124 126
    void on_actionConfigureViews_triggered();