bool SciDoc::save(QString& error) { // LOGGER; if ( isNoname() ) { error = "This is a Noname file and shouldn't be saved directly"; return false; } if ( MainSettings::get(MainSettings::StripTrailingSpaces) ) stripTrailingSpaces(); bool result; stopWatcher(); QFile file(fileName()); if ( file.open(QIODevice::WriteOnly) ) { QString text(""); text = int_->edit1_->text(); file.write(codec()->fromUnicode(text)); file.close(); // Document::save(error); int_->edit1_->setModified(false); result = true; } else { error = tr("Can't open file for writing"); result = false; } startWatcher(); return result; }
void KWatchGnuPGMainWindow::slotWatcherExited() { if( KMessageBox::questionYesNo( this, i18n("The watchgnupg logging process died.\nDo you want to try to restart it?"), QString::null, i18n("Try Restart"), i18n("Do Not Try") ) == KMessageBox::Yes ) { mCentralWidget->append( i18n("====== Restarting logging process =====") ); startWatcher(); } else { KMessageBox::sorry( this, i18n("The watchgnupg logging process is not running.\nThis log window is now completely useless." ) ); } }
void KWatchGnuPGMainWindow::slotReadConfig() { KConfig* config = kapp->config(); config->setGroup("LogWindow"); mCentralWidget->setWordWrap( config->readBoolEntry("WordWrap", false) ?QTextEdit::WidgetWidth :QTextEdit::NoWrap ); mCentralWidget->setMaxLogLines( config->readNumEntry( "MaxLogLen", 10000 ) ); setGnuPGConfig(); startWatcher(); }
JNIEXPORT void JNICALL Java_com_congnt_ndkguide_Store_initializeStore(JNIEnv* pEnv, jobject pThis) { mStore.mLength = 0; startWatcher(pEnv, &mStoreWatcher, &mStore, pThis); }