[280] | 1 | /* ruserdialog.cc |
---|
| 2 | * |
---|
| 3 | * Copyright (c) 2003 Conectiva S/A |
---|
| 4 | * |
---|
| 5 | * Author: Alfredo K. Kojima <kojima@conectiva.com.br> |
---|
| 6 | * Michael Vogt <mvo@debian.org> |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License as |
---|
| 10 | * published by the Free Software Foundation; either version 2 of the |
---|
| 11 | * License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
| 21 | * USA |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | #include <apt-pkg/error.h> |
---|
| 25 | |
---|
| 26 | #include <ruserdialog.h> |
---|
| 27 | |
---|
| 28 | bool RUserDialog::showErrors() |
---|
| 29 | { |
---|
| 30 | if (_error->empty()) |
---|
| 31 | return false; |
---|
| 32 | |
---|
| 33 | while (!_error->empty()) { |
---|
| 34 | string message; |
---|
| 35 | bool iserror = _error->PopMessage(message); |
---|
| 36 | |
---|
| 37 | // Ignore some stupid error messages. |
---|
| 38 | if (message == "Tried to dequeue a fetching object") |
---|
| 39 | continue; |
---|
| 40 | |
---|
| 41 | if (!message.empty()) { |
---|
| 42 | if (iserror) |
---|
| 43 | error(message.c_str()); |
---|
| 44 | else |
---|
| 45 | warning(message.c_str()); |
---|
| 46 | } |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | return true; |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | // vim:ts=3:sw=3:et |
---|