~ubuntu-branches/ubuntu/vivid/aptitude/vivid

« back to all changes in this revision

Viewing changes to src/cmdline/cmdline_why.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-06-22 12:32:56 UTC
  • mfrom: (1.8.6 sid)
  • Revision ID: james.westby@ubuntu.com-20110622123256-8aox9w9ch3x72dci
Tags: 0.6.4-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/05aptitude: never autoremove kernels
  - drop aptitude-doc to Suggests
  - 03_branding.dpatch: ubuntu branding
  - 04_changelog.dpatch: take changelogs from changelogs.ubuntu.com
  - 09_ubuntu_fortify_source.dpatch: Suppress a number of warnings (turned
    into errors by -Werror) triggered by Ubuntu's default of
    -D_FORTIFY_SOURCE=2.
  - 11_ubuntu_uses_sudo.dpatch: fix status line of 'Become root' menu entry
    to not refer to su.
  - 12_point_manpage_to_doc_package.dpatch: point Finnish manpage to the
    correct place for further info
  - 14_html2text_preferred.dpatch: switch back to html2text in favor of
    elinks, since html2text is in main and elinks isn't.
* dropped 01_intltool_update.dpatch
* updated 15_ftbfs_new_apt

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
 
61
61
namespace cw = cwidget;
62
62
using aptitude::cmdline::create_terminal;
63
 
using aptitude::cmdline::terminal;
 
63
using aptitude::cmdline::terminal_io;
 
64
using aptitude::cmdline::terminal_metrics;
64
65
using aptitude::why::make_cmdline_why_callbacks;
65
66
using aptitude::why::why_callbacks;
66
67
using boost::make_shared;
1104
1105
    {
1105
1106
      class cmdline_why_callbacks : public why_callbacks
1106
1107
      {
1107
 
        const shared_ptr<terminal> term;
 
1108
        const shared_ptr<terminal_metrics> term_metrics;
1108
1109
        const int verbosity;
1109
1110
        const unsigned int screen_width;
1110
1111
 
1111
1112
      public:
1112
 
        cmdline_why_callbacks(const shared_ptr<terminal> &_term,
 
1113
        cmdline_why_callbacks(const shared_ptr<terminal_metrics> &_term_metrics,
1113
1114
                              const int _verbosity)
1114
 
          : term(_term),
 
1115
          : term_metrics(_term_metrics),
1115
1116
            verbosity(_verbosity),
1116
 
            screen_width(_term->get_screen_width())
 
1117
            screen_width(_term_metrics->get_screen_width())
1117
1118
        {
1118
1119
        }
1119
1120
 
1208
1209
 
1209
1210
    shared_ptr<why_callbacks>
1210
1211
    make_cmdline_why_callbacks(const int verbosity,
1211
 
                               const shared_ptr<terminal> &term)
 
1212
                               const shared_ptr<terminal_metrics> &term_metrics)
1212
1213
    {
1213
 
      return make_shared<cmdline_why_callbacks>(term, verbosity);
 
1214
      return make_shared<cmdline_why_callbacks>(term_metrics, verbosity);
1214
1215
    }
1215
1216
  }
1216
1217
}
1298
1299
           aptitude::why::roots_string_mode display_mode,
1299
1300
           int verbosity,
1300
1301
           bool root_is_removal,
1301
 
           const shared_ptr<terminal> &term)
 
1302
           const shared_ptr<terminal_metrics> &term_metrics)
1302
1303
{
1303
1304
  bool success = false;
1304
1305
  const shared_ptr<why_callbacks> callbacks =
1305
 
    make_cmdline_why_callbacks(verbosity, term);
 
1306
    make_cmdline_why_callbacks(verbosity, term_metrics);
1306
1307
  std::auto_ptr<cw::fragment> f(do_why(leaves, root, display_mode,
1307
1308
                                       verbosity, root_is_removal,
1308
1309
                                       callbacks,
1309
1310
                                       success));
1310
 
  const unsigned int screen_width = term->get_screen_width();
 
1311
  const unsigned int screen_width = term_metrics->get_screen_width();
1311
1312
  // TODO: display each result as we find it.
1312
1313
  std::cout << f->layout(screen_width, screen_width, cw::style());
1313
1314
 
1407
1408
                aptitude::why::roots_string_mode display_mode,
1408
1409
                bool is_why_not)
1409
1410
{
1410
 
  const shared_ptr<terminal> term = create_terminal();
 
1411
  const shared_ptr<terminal_io> term = create_terminal();
1411
1412
 
1412
1413
  _error->DumpErrors();
1413
1414