void KdevDoc::removeView(KdevView *view) { pViewList->remove(view); if(!pViewList->isEmpty()) changedViewList(); else deleteContents(); }
bool XADDoc::saveModified() { bool completed=true; if(modified) { XADApp *win=(XADApp *) parent(); int want_save = KMessageBox::warningYesNoCancel(win, i18n("The current file has been modified.\n" "Do you want to save it?"), i18n("Warning")); switch(want_save) { case KMessageBox::Yes: if (doc_url.fileName() == i18n("Untitled")) { win->slotFileSaveAs(); } else { saveDocument(URL()); }; deleteContents(); completed=true; break; case KMessageBox::No: setModified(false); deleteContents(); completed=true; break; case KMessageBox::Cancel: completed=false; break; default: completed=false; break; } } return completed; }
bool KVerbosDoc::saveModified() { bool completed=true; if(modified) { KVerbosApp *win=(KVerbosApp *) parent(); int want_save = KMessageBox::warningYesNoCancel(win, i18n("The current file has been modified.\nDo you want to save it?"), i18n("Warning"),KStdGuiItem::save(),KStdGuiItem::discard()); switch(want_save) { // ich habe die Nummern gegenüber den originalen Nummern in der case-Anweisung // vertauscht, weil die originalen Nummern verkehrt zugeordnet sind!. // In der Dokumentation zu KMessageBox kann man die richtige Zuordnung der Buttons finden. case 2: // CANCEL completed=false; break; case 3: // YES if (doc_url.fileName() == i18n("Untitled")) { win->slotFileSaveAs(); } else { saveDocument(URL()); }; deleteContents(); completed=true; break; case 4: // NO setModified(false); deleteContents(); completed=true; break; default: // Verhalten wie CANCEL completed=false; break; } } return completed; }
bool KVerbosDoc::openDocument(const KURL& url, const char *format /*=0*/) { bool b = false; QString tmpfile; KIO::NetAccess::download( url, tmpfile ); QFile file(url.path()); if ( file.open(IO_ReadOnly) ) { // file opened successfully deleteContents(); if ((url.fileName().right(4) == "html")||(url.fileName().right(3) == "htm")) { // qWarning("öffnen eines HTML-files"); b = openDocHTML(file); } else { // qWarning("öffnen eines .verbos-files"); b = openDocVERBOS(file); }; file.close(); // Liste der Verben sortieren spanishVerbList vl; spanishVerbList::Iterator it1 = verbList2.begin(); spanishVerbList::Iterator it2; while (it1 != verbList2.end()) { it2 = vl.begin(); bool inserted = false; while (it2 != vl.end()) { if (*it1 < *it2) { vl.insert(it2, *it1); inserted = true; it2 = vl.end(); } else it2++; }; if (!inserted) vl.insert(it2, *it1); it1++; }; verbList2.clear(); verbList2 = vl; benutzer->fillList(getList()); emit changeView(); }; KIO::NetAccess::removeTempFile( tmpfile ); modified=false; emit anzahlVerbenGeaendert(getAnzahl()); return b; }
bool Palette::load(QTextStream& stream, bool loadName /* = true */) { bool result = true; setName("KDE palette"); int lineNum = 0; while (!stream.atEnd()) { QString string = stream.readLine().append(' '); if(string.find( QRegExp("[^\\s]") ) == -1 || string.stripWhiteSpace().at( 0 ) == '#' || ( loadName && lineNum == 0 )) { if(loadName && lineNum == 0) setName(string.stripWhiteSpace()); } else { Color* newColor = new Color(); int position = string.find(QRegExp( "[^\\s]" )); for(int componentIndex = 0; componentIndex < Color::COMPONENTS_NUM; ++componentIndex) { if(position == -1) { m_errorString = i18n("Invalid format"); result = false; break; } int endPosition = string.find(QRegExp( "\\s" ), position); if(endPosition == -1) { m_errorString = i18n("Invalid format"); result = false; break; } QString componentString = string.mid(position, endPosition - position); int componentValue = componentString.toInt(&result); if(!result || componentValue < 0 || componentValue > RGB_MAX_COMPONENT_VALUE) { m_errorString = i18n("Invalid format"); result = false; break; } newColor->setComponent(componentIndex, componentValue); position = string.find(QRegExp( "[^\\s]" ), endPosition); } if(!result) { delete newColor; break; } if(position != -1) newColor->setName(string.mid( position ).stripWhiteSpace()); colors.append(newColor); } ++lineNum; } if(!result) deleteContents(); return result; }
template<class T> WStringObjectList<T>::~WStringObjectList() { /************************************************************/ deleteContents(); }
/// Destructor TestSuite::~TestSuite() { deleteContents(); }
CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>::~CrsMatrixStruct() { deleteContents(); }
void XADDoc::closeDocument() { deleteContents(); }
void KraftDoc::closeDocument() { deleteContents(); }
void KVerbosDoc::closeDocument() { deleteContents(); }
Katalysator2Doc::~Katalysator2Doc() { if(doc!=0) deleteContents(); }
void Katalysator2Doc::closeDocument() { deleteContents(); }