[zypp-commit] r6799 - in /trunk/updater-kde/updater/zypp: ZYppUpdater.cpp ZYppUpdater.h
Author: tgoettlicher Date: Tue Aug 21 16:33:34 2007 New Revision: 6799 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6799&view=rev Log: unification and cleanup of xml Modified: trunk/updater-kde/updater/zypp/ZYppUpdater.cpp trunk/updater-kde/updater/zypp/ZYppUpdater.h Modified: trunk/updater-kde/updater/zypp/ZYppUpdater.cpp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppUpdater.cpp?rev=6799&r1=6798&r2=6799&view=diff ============================================================================== --- trunk/updater-kde/updater/zypp/ZYppUpdater.cpp (original) +++ trunk/updater-kde/updater/zypp/ZYppUpdater.cpp Tue Aug 21 16:33:34 2007 @@ -121,10 +121,16 @@ _errorList+=_stderr_buffer; - if (!_messageList.isEmpty()) + if (!_warningList.isEmpty()) { - for (unsigned int i=0; i < _messageList.size(); ++i) - QMessageBox::information( NULL, PROGRAM_DISPLAY_NAME, _messageList[i]); + for (unsigned int i=0; i < _warningList.size(); ++i) + QMessageBox::warning( NULL, PROGRAM_DISPLAY_NAME, _warningList[i]); + } + + if (!_infoList.isEmpty()) + { + for (unsigned int i=0; i < _infoList.size(); ++i) + QMessageBox::information( NULL, PROGRAM_DISPLAY_NAME, _infoList[i]); } if (!_errorList.isEmpty()) @@ -137,7 +143,8 @@ } } - _messageList.clear(); + _warningList.clear(); + _infoList.clear(); _errorList.clear(); _stderr_buffer.truncate(0); return err; @@ -502,24 +509,30 @@ } if ( _state == Error ) { - _error_buffer += ch; _errorList += ch; } + if ( _state == Warning ) + { + _warningList += ch; + } + if ( _state == Info ) + { + _infoList += ch; + } + return true; } bool ZYppUpdater::startElement( const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts ) { - if ( qName == "errors") - { - _state = Errors; - } if ( qName == "message") { if (atts.value("type") == "error") - _errorList += atts.value("text"); - else - _messageList += atts.value("text"); + _state=Error; + else if (atts.value("type") == "warning") + _state=Warning; + else if (atts.value("type") == "info") + _state=Info; } if (qName == "progress") { @@ -532,11 +545,6 @@ emit setProgress( atts.value("value").toInt(), 100, atts.value("name")); // } } - if ( (qName == "error") && (_state == Errors ) ) - { - _state = Error; - _error = true; - } if( qName == "appletinfo" ) { if (atts.value("status") == "no-update-repositories") @@ -600,12 +608,7 @@ { _state = Unknown; } - if ( (qName == "error") && (_state == Error) ) - { - _error_buffer += "\n"; - _state = Errors; - } - if ( (qName == "message") && (_state == Message ) ) + if ( (qName == "message") ) { _state = Unknown; } Modified: trunk/updater-kde/updater/zypp/ZYppUpdater.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppUpdater.h?rev=6799&r1=6798&r2=6799&view=diff ============================================================================== --- trunk/updater-kde/updater/zypp/ZYppUpdater.h (original) +++ trunk/updater-kde/updater/zypp/ZYppUpdater.h Tue Aug 21 16:33:34 2007 @@ -65,9 +65,9 @@ UpdateDescription, UpdateSummary, UpdateLicense, - Errors, Error, - Message, + Warning, + Info, Progress, } XmlState; @@ -163,7 +163,8 @@ QString _error_buffer; QString _message_buffer; QStringList _errorList; - QStringList _messageList; + QStringList _warningList; + QStringList _infoList; QString _install_stderr_buffer; QString _install_stdout_buffer; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
tgoettlicher@svn.opensuse.org