~user-none/kdocker/EmbedContainer

« back to all changes in this revision

Viewing changes to src/trayitemmanager.cpp

  • Committer: John Schember
  • Date: 2009-09-14 23:44:55 UTC
  • Revision ID: john@nachtimwald.com-20090914234455-5gx2j4jmathfegwn
Keep a count of all instances starting so that it won't exit while another is starting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
}
44
44
 
45
45
TrayItemManager::TrayItemManager() {
 
46
    m_startingCount = 0;
46
47
    m_scanner = new Scanner();
47
48
    connect(m_scanner, SIGNAL(windowFound(Window, TrayItemSettings)), this, SLOT(dockWindow(Window, TrayItemSettings)));
48
49
    connect(m_scanner, SIGNAL(stopping()), this, SLOT(checkCount()));
97
98
}
98
99
 
99
100
void TrayItemManager::processCommand(const QStringList &args) {
 
101
    m_startingCount++;
 
102
 
100
103
    int option;
101
104
    Window window = 0;
102
105
    bool checkNormality = true;
207
210
        if (window) {
208
211
            dockWindow(window, settings);
209
212
        } else {
 
213
            m_startingCount--;
210
214
            checkCount();
211
215
        }
212
216
    }
244
248
        }
245
249
    }
246
250
    m_trayItems.append(ti);
 
251
    m_startingCount--;
247
252
}
248
253
 
249
254
Window TrayItemManager::userSelectWindow(bool checkNormality) {
306
311
}
307
312
 
308
313
void TrayItemManager::checkCount() {
309
 
    if (m_trayItems.isEmpty() && !m_scanner->isRunning()) {
 
314
    if (m_trayItems.isEmpty() && !m_scanner->isRunning() && !m_startingCount) {
310
315
        ::exit(0);
311
316
    }
312
317
}