kowindowlist.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <kdebug.h>
00026
00027 #include "actionmanager.h"
00028 #include "kowindowlist.h"
00029 #include "kowindowlist.moc"
00030
00031 KOWindowList::KOWindowList( const char *name )
00032 : QObject( 0, name ), mDefaultWindow( 0 )
00033 {
00034 kdDebug(5850) << "KOWindowList::KOWindowList()" << endl;
00035 }
00036
00037 KOWindowList::~KOWindowList()
00038 {
00039 }
00040
00041 void KOWindowList::addWindow( KOrg::MainWindow *korg )
00042 {
00043 if ( !korg->hasDocument() ) mDefaultWindow = korg;
00044 else mWindowList.append( korg );
00045 }
00046
00047 void KOWindowList::removeWindow( KOrg::MainWindow *korg )
00048 {
00049 if ( korg == mDefaultWindow ) mDefaultWindow = 0;
00050 else mWindowList.removeRef( korg );
00051 }
00052
00053 bool KOWindowList::lastInstance()
00054 {
00055 if ( mWindowList.count() == 1 && !mDefaultWindow ) return true;
00056 if ( mWindowList.count() == 0 && mDefaultWindow ) return true;
00057 else return false;
00058 }
00059
00060 KOrg::MainWindow *KOWindowList::findInstance( const KURL &url )
00061 {
00062 KOrg::MainWindow *inst;
00063 for( inst = mWindowList.first(); inst; inst = mWindowList.next() )
00064 if ( inst->getCurrentURL() == url )
00065 return inst;
00066 return 0;
00067 }
00068
00069 KOrg::MainWindow *KOWindowList::defaultInstance()
00070 {
00071 return mDefaultWindow;
00072 }
This file is part of the documentation for korganizer Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Mar 6 17:18:33 2004 by
doxygen 1.3.6-20040222 written by
Dimitri van Heesch, © 1997-2003