Commit d1a12f60 authored by daniel_e's avatar daniel_e
Browse files

(error_pixbuf_): Get rid of this silly cache, since it became useless

a while ago.
parent 96047190
2003-01-01 Daniel Elstner <daniel.elstner@gmx.net>
* src/filetree.{cc,h} (error_pixbuf_): Get rid of this silly cache,
since it became useless a while ago.
2003-01-01 Daniel Elstner <daniel.elstner@gmx.net>
* src/aboutdialog.cc (SelectableLabel): Add accessibility hints.
......
......@@ -112,10 +112,6 @@ void FileTree::find_files(const std::string& dirname, Pcre::Pattern& pattern,
get_selection()->unselect_all(); // workaround for GTK+ <= 2.0.6 (#94868)
treestore_->clear();
// Don't keep the pixbuf around if we don't need it.
// It's recreated on demand if necessary.
error_pixbuf_.clear();
toplevel_.file_count = 0;
toplevel_.modified_count = 0;
sum_matches_ = 0;
......@@ -290,8 +286,6 @@ void FileTree::on_style_changed(const Glib::RefPtr<Gtk::Style>& previous_style)
color_load_failed_ = get_style()->get_text(Gtk::STATE_INSENSITIVE);
error_pixbuf_.clear();
Gtk::TreeView::on_style_changed(previous_style);
}
......@@ -1040,7 +1034,8 @@ void FileTree::load_file_with_fallback(const Gtk::TreeModel::iterator& iter,
}
catch(const Glib::Error& error)
{
fileinfo->buffer = create_error_message_buffer(error.what());
fileinfo->buffer = FileBuffer::create_with_error_message(
render_icon(Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_DIALOG), error.what());
}
if(!fileinfo->buffer)
......@@ -1051,7 +1046,8 @@ void FileTree::load_file_with_fallback(const Gtk::TreeModel::iterator& iter,
message += Util::filename_to_utf8_fallback(Glib::path_get_basename(fileinfo->fullname));
message += "\302\253 seems to be a binary file.";
fileinfo->buffer = create_error_message_buffer(message);
fileinfo->buffer = FileBuffer::create_with_error_message(
render_icon(Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_DIALOG), message);
}
if(old_load_failed != fileinfo->load_failed)
......@@ -1062,13 +1058,5 @@ void FileTree::load_file_with_fallback(const Gtk::TreeModel::iterator& iter,
}
}
Glib::RefPtr<FileBuffer> FileTree::create_error_message_buffer(const Glib::ustring& message)
{
if(!error_pixbuf_)
error_pixbuf_ = render_icon(Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_DIALOG);
return FileBuffer::create_with_error_message(error_pixbuf_, message);
}
} // namespace Regexxer
......@@ -115,7 +115,6 @@ private:
Gtk::TreePath path_match_last_;
std::string fallback_encoding_;
Glib::RefPtr<Gdk::Pixbuf> error_pixbuf_;
void icon_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
void text_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
......@@ -153,7 +152,6 @@ private:
void propagate_modified_change(const Gtk::TreeModel::iterator& pos, bool modified);
void load_file_with_fallback(const Gtk::TreeModel::iterator& iter, const FileInfoPtr& fileinfo);
Glib::RefPtr<FileBuffer> create_error_message_buffer(const Glib::ustring& message);
// Work-around for silly, stupid, and annoying gcc 2.95.x.
friend class FileTree::ScopedBlockSorting;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment