Skip to content

Instantly share code, notes, and snippets.

@neeravkumar
Created February 2, 2014 04:45
Show Gist options
  • Save neeravkumar/8763174 to your computer and use it in GitHub Desktop.
Save neeravkumar/8763174 to your computer and use it in GitHub Desktop.
diff -Naur newsbeuter-2.8/Makefile newsbeuter-2.8-m/Makefile
--- newsbeuter-2.8/Makefile 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/Makefile 2014-02-02 12:43:11.000000000 +0800
@@ -11,7 +11,7 @@
# compiler and linker flags
DEFINES=-DLOCALEDIR=\"$(localedir)\"
WARNFLAGS=-Wall -Wextra
-CXXFLAGS+=-ggdb -Iinclude -Istfl -Ifilter -I. -Irss $(WARNFLAGS) $(DEFINES)
+CXXFLAGS+=-std=c++11 -ggdb -Iinclude -Istfl -Ifilter -I. -Irss $(WARNFLAGS) $(DEFINES)
LDFLAGS+=-L.
PACKAGE=newsbeuter
@@ -119,7 +119,7 @@
$(RM) $(FILTERLIB_OUTPUT) $(FILTERLIB_OBJS)
#clean-doc:
-# $(RM) -r doc/xhtml
+# $(RM) -r doc/xhtml
# $(RM) doc/*.xml doc/*.1 doc/newsbeuter-cfgcmds.txt doc/podbeuter-cfgcmds.txt doc/newsbeuter-keycmds.txt
clean: clean-newsbeuter clean-podbeuter clean-libbeuter clean-libfilter clean-librsspp
diff -Naur newsbeuter-2.8/TODO newsbeuter-2.8-m/TODO
--- newsbeuter-2.8/TODO 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/TODO 2014-02-02 12:41:26.000000000 +0800
@@ -125,7 +125,7 @@
- add a second "downloaded, but unlistened" queue to podbeuter (solved by marking downloaded but unplayed files in the queue file)
- implement "newsrc" style file format to exchange information about read articles.
- make ":<number>" work on urlview dialog
-- replace std::vector<rss_item> with std::vector<std::tr1::shared_ptr<rss_item> > as a possible fix against these weird crashes.
+- replace std::vector<rss_item> with std::vector<std::shared_ptr<rss_item> > as a possible fix against these weird crashes.
beta tester: mhellwig@in-ulm.de (regular crashes on sparc Linux)
- write documentation on feed-sortorder and related changes
- use categories from OPML also when it is directly used as source
diff -Naur newsbeuter-2.8/doc/xhtml/newsbeuter.html newsbeuter-2.8-m/doc/xhtml/newsbeuter.html
--- newsbeuter-2.8/doc/xhtml/newsbeuter.html 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/doc/xhtml/newsbeuter.html 2014-02-02 12:41:26.000000000 +0800
@@ -2353,4 +2353,4 @@
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.</p></div></div></body></html>
\ No newline at end of file
+SOFTWARE.</p></div></div></body></html>
diff -Naur newsbeuter-2.8/include/cache.h newsbeuter-2.8-m/include/cache.h
--- newsbeuter-2.8/include/cache.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/cache.h 2014-02-02 12:41:26.000000000 +0800
@@ -15,15 +15,15 @@
public:
cache(const std::string& cachefile, configcontainer * c);
~cache();
- void externalize_rssfeed(std::tr1::shared_ptr<rss_feed> feed, bool reset_unread);
- void internalize_rssfeed(std::tr1::shared_ptr<rss_feed> feed, rss_ignores * ign);
- void update_rssitem_unread_and_enqueued(std::tr1::shared_ptr<rss_item> item, const std::string& feedurl);
+ void externalize_rssfeed(std::shared_ptr<rss_feed> feed, bool reset_unread);
+ void internalize_rssfeed(std::shared_ptr<rss_feed> feed, rss_ignores * ign);
+ void update_rssitem_unread_and_enqueued(std::shared_ptr<rss_item> item, const std::string& feedurl);
void update_rssitem_unread_and_enqueued(rss_item* item, const std::string& feedurl);
- void cleanup_cache(std::vector<std::tr1::shared_ptr<rss_feed> >& feeds);
+ void cleanup_cache(std::vector<std::shared_ptr<rss_feed> >& feeds);
void do_vacuum();
- std::vector<std::tr1::shared_ptr<rss_item> > search_for_items(const std::string& querystr, const std::string& feedurl);
+ std::vector<std::shared_ptr<rss_item> > search_for_items(const std::string& querystr, const std::string& feedurl);
void catchup_all(const std::string& feedurl = "");
- void catchup_all(std::tr1::shared_ptr<rss_feed> feed);
+ void catchup_all(std::shared_ptr<rss_feed> feed);
void update_rssitem_flags(rss_item* item);
std::vector<std::string> get_feed_urls();
void fetch_lastmodified(const std::string& uri, time_t& t, std::string& etag);
@@ -40,9 +40,9 @@
private:
void populate_tables();
void set_pragmas();
- void delete_item(const std::tr1::shared_ptr<rss_item> item);
+ void delete_item(const std::shared_ptr<rss_item> item);
void clean_old_articles();
- void update_rssitem_unlocked(std::tr1::shared_ptr<rss_item> item, const std::string& feedurl, bool reset_unread);
+ void update_rssitem_unlocked(std::shared_ptr<rss_item> item, const std::string& feedurl, bool reset_unread);
std::string prepare_query(const char * format, ...);
diff -Naur newsbeuter-2.8/include/controller.h newsbeuter-2.8-m/include/controller.h
--- newsbeuter-2.8/include/controller.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/controller.h 2014-02-02 12:41:26.000000000 +0800
@@ -35,9 +35,9 @@
void reload_range(unsigned int start, unsigned int end, unsigned int size, bool unattended = false);
void start_reload_all_thread(std::vector<int> * indexes = 0);
- std::tr1::shared_ptr<rss_feed> get_feed(unsigned int pos);
- std::tr1::shared_ptr<rss_feed> get_feed_by_url(const std::string& feedurl);
- std::vector<std::tr1::shared_ptr<rss_item> > search_for_items(const std::string& query, const std::string& feedurl);
+ std::shared_ptr<rss_feed> get_feed(unsigned int pos);
+ std::shared_ptr<rss_feed> get_feed_by_url(const std::string& feedurl);
+ std::vector<std::shared_ptr<rss_item> > search_for_items(const std::string& query, const std::string& feedurl);
inline unsigned int get_feedcount() { return feeds.size(); }
inline void unlock_reload_mutex() { reload_mutex.unlock(); }
@@ -49,18 +49,18 @@
void mark_article_read(const std::string& guid, bool read);
void record_google_replay(const std::string& guid, bool read);
void catchup_all();
- inline void catchup_all(std::tr1::shared_ptr<rss_feed> feed) { rsscache->catchup_all(feed); }
+ inline void catchup_all(std::shared_ptr<rss_feed> feed) { rsscache->catchup_all(feed); }
inline bool get_refresh_on_start() const { return refresh_on_start; }
bool is_valid_podcast_type(const std::string& mimetype);
- void enqueue_url(const std::string& url, std::tr1::shared_ptr<rss_feed> feed);
+ void enqueue_url(const std::string& url, std::shared_ptr<rss_feed> feed);
void notify(const std::string& msg);
unsigned int get_pos_of_next_unread(unsigned int pos);
void reload_urls_file();
void edit_urls_file();
- std::vector<std::tr1::shared_ptr<rss_feed> > get_all_feeds();
- std::vector<std::tr1::shared_ptr<rss_feed> > get_all_feeds_unlocked();
+ std::vector<std::shared_ptr<rss_feed> > get_all_feeds();
+ std::vector<std::shared_ptr<rss_feed> > get_all_feeds_unlocked();
inline filtercontainer& get_filters() { return filters; }
@@ -70,9 +70,9 @@
inline configcontainer * get_cfg() { return &cfg; }
- void write_item(std::tr1::shared_ptr<rss_item> item, const std::string& filename);
- void write_item(std::tr1::shared_ptr<rss_item> item, std::ostream& ostr);
- std::string write_temporary_item(std::tr1::shared_ptr<rss_item> item);
+ void write_item(std::shared_ptr<rss_item> item, const std::string& filename);
+ void write_item(std::shared_ptr<rss_item> item, std::ostream& ostr);
+ std::string write_temporary_item(std::shared_ptr<rss_item> item);
void mark_deleted(const std::string& guid, bool b);
@@ -84,7 +84,7 @@
void sort_feeds();
- void update_flags(std::tr1::shared_ptr<rss_item> item);
+ void update_flags(std::shared_ptr<rss_item> item);
unsigned int get_feed_count_per_tag(const std::string& tag);
private:
@@ -99,10 +99,10 @@
void execute_commands(char ** argv, unsigned int i);
std::string prepare_message(unsigned int pos, unsigned int max);
- void save_feed(std::tr1::shared_ptr<rss_feed> feed, unsigned int pos);
- void enqueue_items(std::tr1::shared_ptr<rss_feed> feed);
+ void save_feed(std::shared_ptr<rss_feed> feed, unsigned int pos);
+ void enqueue_items(std::shared_ptr<rss_feed> feed);
- std::string generate_enqueue_filename(const std::string& url, std::tr1::shared_ptr<rss_feed> feed);
+ std::string generate_enqueue_filename(const std::string& url, std::shared_ptr<rss_feed> feed);
std::string get_hostname_from_url(const std::string& url);
void import_read_information(const std::string& readinfofile);
@@ -111,7 +111,7 @@
view * v;
urlreader * urlcfg;
cache * rsscache;
- std::vector<std::tr1::shared_ptr<rss_feed> > feeds;
+ std::vector<std::shared_ptr<rss_feed> > feeds;
std::string config_dir;
std::string url_file;
std::string cache_file;
diff -Naur newsbeuter-2.8/include/feedlist_formaction.h newsbeuter-2.8-m/include/feedlist_formaction.h
--- newsbeuter-2.8/include/feedlist_formaction.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/feedlist_formaction.h 2014-02-02 12:41:26.000000000 +0800
@@ -9,7 +9,7 @@
namespace newsbeuter {
-typedef std::pair<std::tr1::shared_ptr<rss_feed>, unsigned int> feedptr_pos_pair;
+typedef std::pair<std::shared_ptr<rss_feed>, unsigned int> feedptr_pos_pair;
class feedlist_formaction : public formaction {
public:
@@ -17,11 +17,11 @@
virtual ~feedlist_formaction();
virtual void prepare();
virtual void init();
- void set_feedlist(std::vector<std::tr1::shared_ptr<rss_feed> >& feeds);
- void update_visible_feeds(std::vector<std::tr1::shared_ptr<rss_feed> >& feeds);
+ void set_feedlist(std::vector<std::shared_ptr<rss_feed> >& feeds);
+ void update_visible_feeds(std::vector<std::shared_ptr<rss_feed> >& feeds);
void set_tags(const std::vector<std::string>& t);
virtual keymap_hint_entry * get_keymap_hint();
- std::tr1::shared_ptr<rss_feed> get_feed();
+ std::shared_ptr<rss_feed> get_feed();
virtual void set_redraw(bool b) {
formaction::set_redraw(b);
@@ -61,9 +61,9 @@
void set_pos();
- std::string get_title(std::tr1::shared_ptr<rss_feed> feed);
+ std::string get_title(std::shared_ptr<rss_feed> feed);
- std::string format_line(const std::string& feedlist_format, std::tr1::shared_ptr<rss_feed> feed, unsigned int pos, unsigned int width);
+ std::string format_line(const std::string& feedlist_format, std::shared_ptr<rss_feed> feed, unsigned int pos, unsigned int width);
bool zero_feedpos;
unsigned int feeds_shown;
@@ -78,7 +78,7 @@
history filterhistory;
- std::tr1::shared_ptr<rss_feed> search_dummy_feed;
+ std::shared_ptr<rss_feed> search_dummy_feed;
unsigned int filterpos;
bool set_filterpos;
diff -Naur newsbeuter-2.8/include/formaction.h newsbeuter-2.8-m/include/formaction.h
--- newsbeuter-2.8/include/formaction.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/formaction.h 2014-02-02 12:41:26.000000000 +0800
@@ -26,7 +26,7 @@
virtual ~formaction();
virtual void prepare() = 0;
virtual void init() = 0;
- std::tr1::shared_ptr<stfl::form> get_form();
+ std::shared_ptr<stfl::form> get_form();
virtual void set_redraw(bool b) { do_redraw = b; }
virtual keymap_hint_entry * get_keymap_hint() = 0;
@@ -48,8 +48,8 @@
inline std::string get_qna_response(unsigned int i) { return (qna_responses.size() >= (i + 1)) ? qna_responses[i] : ""; }
void start_qna(const std::vector<qna_pair>& prompts, operation finish_op, history * h = NULL);
- inline void set_parent_formaction(std::tr1::shared_ptr<formaction> fa) { parent_formaction = fa; }
- inline std::tr1::shared_ptr<formaction> get_parent_formaction() const { return parent_formaction; }
+ inline void set_parent_formaction(std::shared_ptr<formaction> fa) { parent_formaction = fa; }
+ inline std::shared_ptr<formaction> get_parent_formaction() const { return parent_formaction; }
virtual std::string title() = 0;
@@ -66,7 +66,7 @@
void start_bookmark_qna(const std::string& default_title, const std::string& default_url, const std::string& default_desc);
view * v;
- std::tr1::shared_ptr<stfl::form> f;
+ std::shared_ptr<stfl::form> f;
bool do_redraw;
std::vector<std::string> qna_responses;
@@ -84,7 +84,7 @@
std::vector<qna_pair> qna_prompts;
operation finish_operation;
history * qna_history;
- std::tr1::shared_ptr<formaction> parent_formaction;
+ std::shared_ptr<formaction> parent_formaction;
};
diff -Naur newsbeuter-2.8/include/itemlist_formaction.h newsbeuter-2.8-m/include/itemlist_formaction.h
--- newsbeuter-2.8/include/itemlist_formaction.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/itemlist_formaction.h 2014-02-02 12:41:26.000000000 +0800
@@ -9,7 +9,7 @@
namespace newsbeuter {
-typedef std::pair<std::tr1::shared_ptr<rss_item>, unsigned int> itemptr_pos_pair;
+typedef std::pair<std::shared_ptr<rss_item>, unsigned int> itemptr_pos_pair;
class itemlist_formaction : public formaction {
public:
@@ -24,12 +24,12 @@
update_visible_items = true;
}
- void set_feed(std::tr1::shared_ptr<rss_feed> fd);
+ void set_feed(std::shared_ptr<rss_feed> fd);
virtual std::string id() const { return "articlelist"; }
virtual std::string title();
- inline std::tr1::shared_ptr<rss_feed> get_feed() { return feed; }
+ inline std::shared_ptr<rss_feed> get_feed() { return feed; }
inline void set_pos(unsigned int p) { pos = p; }
std::string get_guid();
virtual keymap_hint_entry * get_keymap_hint();
@@ -60,7 +60,7 @@
void set_head(const std::string& s, unsigned int unread, unsigned int total, const std::string &url);
int get_pos(unsigned int idx);
- void save_article(const std::string& filename, std::tr1::shared_ptr<rss_item> item);
+ void save_article(const std::string& filename, std::shared_ptr<rss_item> item);
void save_filterpos();
@@ -70,13 +70,13 @@
void handle_cmdline_num(unsigned int idx);
- std::string gen_flags(std::tr1::shared_ptr<rss_item> item);
+ std::string gen_flags(std::shared_ptr<rss_item> item);
std::string gen_datestr(time_t t, const char * datetimeformat);
void prepare_set_filterpos();
unsigned int pos;
- std::tr1::shared_ptr<rss_feed> feed;
+ std::shared_ptr<rss_feed> feed;
bool rebuild_list;
bool apply_filter;
matcher m;
@@ -87,7 +87,7 @@
history filterhistory;
- std::tr1::shared_ptr<rss_feed> search_dummy_feed;
+ std::shared_ptr<rss_feed> search_dummy_feed;
mutex redraw_mtx;
diff -Naur newsbeuter-2.8/include/itemview_formaction.h newsbeuter-2.8-m/include/itemview_formaction.h
--- newsbeuter-2.8/include/itemview_formaction.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/itemview_formaction.h 2014-02-02 12:41:26.000000000 +0800
@@ -12,7 +12,7 @@
class itemview_formaction : public formaction {
public:
- itemview_formaction(view *, std::tr1::shared_ptr<itemlist_formaction> il, std::string formstr);
+ itemview_formaction(view *, std::shared_ptr<itemlist_formaction> il, std::string formstr);
virtual ~itemview_formaction();
virtual void prepare();
virtual void init();
@@ -20,7 +20,7 @@
LOG(LOG_DEBUG, "itemview_formaction::set_guid: new guid = %s", guid_.c_str());
guid = guid_;
}
- inline void set_feed(std::tr1::shared_ptr<rss_feed> fd) { feed = fd; }
+ inline void set_feed(std::shared_ptr<rss_feed> fd) { feed = fd; }
void set_highlightphrase(const std::string& text);
keymap_hint_entry * get_keymap_hint();
virtual void handle_cmdline(const std::string& cmd);
@@ -46,13 +46,13 @@
void do_search();
std::string guid;
- std::tr1::shared_ptr<rss_feed> feed;
+ std::shared_ptr<rss_feed> feed;
bool show_source;
std::vector<linkpair> links;
bool quit;
regexmanager * rxman;
unsigned int num_lines;
- std::tr1::shared_ptr<itemlist_formaction> itemlist;
+ std::shared_ptr<itemlist_formaction> itemlist;
bool in_search;
};
diff -Naur newsbeuter-2.8/include/regexmanager.h newsbeuter-2.8-m/include/regexmanager.h
--- newsbeuter-2.8/include/regexmanager.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/regexmanager.h 2014-02-02 12:41:26.000000000 +0800
@@ -24,7 +24,7 @@
typedef std::pair<std::vector<regex_t *>, std::vector<std::string> > rc_pair;
std::map<std::string, rc_pair> locations;
std::vector<std::string> cheat_store_for_dump_config;
- std::vector<std::pair<std::tr1::shared_ptr<matcher>, int> > matchers;
+ std::vector<std::pair<std::shared_ptr<matcher>, int> > matchers;
std::string extract_initial_marker(const std::string& str);
public:
inline std::vector<std::string>& get_attrs(const std::string& loc) { return locations[loc].second; }
diff -Naur newsbeuter-2.8/include/rss.h newsbeuter-2.8-m/include/rss.h
--- newsbeuter-2.8/include/rss.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/rss.h 2014-02-02 12:41:26.000000000 +0800
@@ -83,8 +83,8 @@
virtual bool has_attribute(const std::string& attribname);
virtual std::string get_attribute(const std::string& attribname);
- void set_feedptr(std::tr1::shared_ptr<rss_feed> ptr);
- inline std::tr1::shared_ptr<rss_feed> get_feedptr() { return feedptr; }
+ void set_feedptr(std::shared_ptr<rss_feed> ptr);
+ inline std::shared_ptr<rss_feed> get_feedptr() { return feedptr; }
inline bool deleted() const { return deleted_; }
inline void set_deleted(bool b) { deleted_ = b; }
@@ -115,7 +115,7 @@
bool enqueued_;
std::string flags_;
std::string oldflags_;
- std::tr1::shared_ptr<rss_feed> feedptr;
+ std::shared_ptr<rss_feed> feedptr;
bool deleted_;
unsigned int idx;
std::string base;
@@ -144,8 +144,8 @@
bool hidden() const;
- inline std::vector<std::tr1::shared_ptr<rss_item> >& items() { return items_; }
- inline void add_item(std::tr1::shared_ptr<rss_item> item) {
+ inline std::vector<std::shared_ptr<rss_item> >& items() { return items_; }
+ inline void add_item(std::shared_ptr<rss_item> item) {
items_.push_back(item);
items_guid_map[item->guid()] = item;
}
@@ -155,19 +155,19 @@
items_guid_map.clear();
}
- inline void erase_items(std::vector<std::tr1::shared_ptr<rss_item> >::iterator begin, std::vector<std::tr1::shared_ptr<rss_item> >::iterator end) {
- for (std::vector<std::tr1::shared_ptr<rss_item> >::const_iterator it=begin;it!=end;++it) {
+ inline void erase_items(std::vector<std::shared_ptr<rss_item> >::iterator begin, std::vector<std::shared_ptr<rss_item> >::iterator end) {
+ for (std::vector<std::shared_ptr<rss_item> >::const_iterator it=begin;it!=end;++it) {
items_guid_map.erase((*it)->guid());
}
items_.erase(begin, end);
}
- inline void erase_item(std::vector<std::tr1::shared_ptr<rss_item> >::iterator pos) {
+ inline void erase_item(std::vector<std::shared_ptr<rss_item> >::iterator pos) {
items_guid_map.erase((*pos)->guid());
items_.erase(pos);
}
- std::tr1::shared_ptr<rss_item> get_item_by_guid(const std::string& guid);
- std::tr1::shared_ptr<rss_item> get_item_by_guid_unlocked(const std::string& guid);
+ std::shared_ptr<rss_item> get_item_by_guid(const std::string& guid);
+ std::shared_ptr<rss_item> get_item_by_guid_unlocked(const std::string& guid);
inline const std::string& rssurl() const { return rssurl_; }
void set_rssurl(const std::string& u);
@@ -183,7 +183,7 @@
virtual bool has_attribute(const std::string& attribname);
virtual std::string get_attribute(const std::string& attribname);
- void update_items(std::vector<std::tr1::shared_ptr<rss_feed> > feeds);
+ void update_items(std::vector<std::shared_ptr<rss_feed> > feeds);
inline void set_query(const std::string& s) { query = s; }
@@ -206,7 +206,7 @@
inline void set_order(unsigned int x) { order = x; }
inline unsigned int get_order() { return order; }
- void set_feedptrs(std::tr1::shared_ptr<rss_feed> self);
+ void set_feedptrs(std::shared_ptr<rss_feed> self);
std::string get_status();
@@ -223,8 +223,8 @@
std::string link_;
time_t pubDate_;
std::string rssurl_;
- std::vector<std::tr1::shared_ptr<rss_item> > items_;
- std::tr1::unordered_map<std::string, std::tr1::shared_ptr<rss_item> > items_guid_map;
+ std::vector<std::shared_ptr<rss_item> > items_;
+ std::unordered_map<std::string, std::shared_ptr<rss_item> > items_guid_map;
std::vector<std::string> tags_;
std::string query;
diff -Naur newsbeuter-2.8/include/rss_parser.h newsbeuter-2.8-m/include/rss_parser.h
--- newsbeuter-2.8/include/rss_parser.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/rss_parser.h 2014-02-02 12:41:26.000000000 +0800
@@ -16,7 +16,7 @@
public:
rss_parser(const std::string& uri, cache * c, configcontainer *, rss_ignores * ii, remote_api * a = 0);
~rss_parser();
- std::tr1::shared_ptr<rss_feed> parse();
+ std::shared_ptr<rss_feed> parse();
bool check_and_update_lastmodified();
void set_easyhandle(curl_handle *h) { easyhandle = h; }
@@ -24,7 +24,7 @@
void replace_newline_characters(std::string& str);
std::string render_xhtml_title(const std::string& title, const std::string& link);
time_t parse_date(const std::string& datestr);
- void set_rtl(std::tr1::shared_ptr<rss_feed> feed, const char * lang);
+ void set_rtl(std::shared_ptr<rss_feed> feed, const char * lang);
void retrieve_uri(const std::string& uri);
void download_http(const std::string& uri);
@@ -32,19 +32,19 @@
void download_filterplugin(const std::string& filter, const std::string& uri);
void parse_file(const std::string& file);
- void fill_feed_fields(std::tr1::shared_ptr<rss_feed> feed);
- void fill_feed_items(std::tr1::shared_ptr<rss_feed> feed);
+ void fill_feed_fields(std::shared_ptr<rss_feed> feed);
+ void fill_feed_items(std::shared_ptr<rss_feed> feed);
- void set_item_title(std::tr1::shared_ptr<rss_feed> feed, std::tr1::shared_ptr<rss_item> x, rsspp::item& item);
- void set_item_author(std::tr1::shared_ptr<rss_item> x, rsspp::item& item);
- void set_item_content(std::tr1::shared_ptr<rss_item> x, rsspp::item& item);
- void set_item_enclosure(std::tr1::shared_ptr<rss_item> x, rsspp::item& item);
+ void set_item_title(std::shared_ptr<rss_feed> feed, std::shared_ptr<rss_item> x, rsspp::item& item);
+ void set_item_author(std::shared_ptr<rss_item> x, rsspp::item& item);
+ void set_item_content(std::shared_ptr<rss_item> x, rsspp::item& item);
+ void set_item_enclosure(std::shared_ptr<rss_item> x, rsspp::item& item);
std::string get_guid(rsspp::item& item);
- void add_item_to_feed(std::tr1::shared_ptr<rss_feed> feed, std::tr1::shared_ptr<rss_item> item);
+ void add_item_to_feed(std::shared_ptr<rss_feed> feed, std::shared_ptr<rss_item> item);
- void handle_content_encoded(std::tr1::shared_ptr<rss_item> x, rsspp::item& item);
- void handle_itunes_summary(std::tr1::shared_ptr<rss_item> x, rsspp::item& item);
+ void handle_content_encoded(std::shared_ptr<rss_item> x, rsspp::item& item);
+ void handle_itunes_summary(std::shared_ptr<rss_item> x, rsspp::item& item);
bool is_html_type(const std::string& type);
void fetch_ttrss(const std::string& feed_id);
void fetch_newsblur(const std::string& feed_id);
diff -Naur newsbeuter-2.8/include/view.h newsbeuter-2.8-m/include/view.h
--- newsbeuter-2.8/include/view.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/include/view.h 2014-02-02 12:41:26.000000000 +0800
@@ -27,10 +27,10 @@
view(controller *);
~view();
void run();
- std::string run_modal(std::tr1::shared_ptr<formaction> f, const std::string& value = "");
+ std::string run_modal(std::shared_ptr<formaction> f, const std::string& value = "");
- void set_feedlist(std::vector<std::tr1::shared_ptr<rss_feed> > feeds);
- void update_visible_feeds(std::vector<std::tr1::shared_ptr<rss_feed> > feeds);
+ void set_feedlist(std::vector<std::shared_ptr<rss_feed> > feeds);
+ void update_visible_feeds(std::vector<std::shared_ptr<rss_feed> > feeds);
void set_keymap(keymap * k);
void set_config_container(configcontainer * cfgcontainer);
void show_error(const std::string& msg);
@@ -48,11 +48,11 @@
char confirm(const std::string& prompt, const std::string& charset);
void push_itemlist(unsigned int pos);
- void push_itemlist(std::tr1::shared_ptr<rss_feed> feed);
- void push_itemview(std::tr1::shared_ptr<rss_feed> f, const std::string& guid, const std::string& searchphrase = "");
+ void push_itemlist(std::shared_ptr<rss_feed> feed);
+ void push_itemview(std::shared_ptr<rss_feed> f, const std::string& guid, const std::string& searchphrase = "");
void push_help();
void push_urlview(const std::vector<linkpair>& links);
- void push_searchresult(std::tr1::shared_ptr<rss_feed> feed, const std::string& phrase = "");
+ void push_searchresult(std::shared_ptr<rss_feed> feed, const std::string& phrase = "");
void view_dialogs();
std::string run_filebrowser(const std::string& default_filename = "", const std::string& dir = "");
@@ -75,13 +75,13 @@
bool get_next_feed(itemlist_formaction * itemlist);
bool get_prev_feed(itemlist_formaction * itemlist);
- void prepare_query_feed(std::tr1::shared_ptr<rss_feed> feed);
+ void prepare_query_feed(std::shared_ptr<rss_feed> feed);
void force_redraw();
void set_colors(std::map<std::string,std::string>& fg_colors, std::map<std::string,std::string>& bg_colors, std::map<std::string,std::vector<std::string> >& attributes);
- void notify_itemlist_change(std::tr1::shared_ptr<rss_feed> feed);
+ void notify_itemlist_change(std::shared_ptr<rss_feed> feed);
void feedlist_mark_pos_if_visible(unsigned int pos);
@@ -89,9 +89,9 @@
std::vector<std::pair<unsigned int, std::string> > get_formaction_names();
- std::tr1::shared_ptr<formaction> get_current_formaction();
+ std::shared_ptr<formaction> get_current_formaction();
- std::tr1::shared_ptr<formaction> get_formaction(unsigned int idx) const { return formaction_stack[idx]; }
+ std::shared_ptr<formaction> get_formaction(unsigned int idx) const { return formaction_stack[idx]; }
void goto_next_dialog();
void goto_prev_dialog();
@@ -106,14 +106,14 @@
void dump_current_form();
protected:
- void set_bindings(std::tr1::shared_ptr<formaction> fa);
- void apply_colors(std::tr1::shared_ptr<formaction> fa);
+ void set_bindings(std::shared_ptr<formaction> fa);
+ void apply_colors(std::shared_ptr<formaction> fa);
- void handle_cmdline_completion(std::tr1::shared_ptr<formaction> fa);
- void clear_line(std::tr1::shared_ptr<formaction> fa);
- void clear_eol(std::tr1::shared_ptr<formaction> fa);
- void cancel_input(std::tr1::shared_ptr<formaction> fa);
- void delete_word(std::tr1::shared_ptr<formaction> fa);
+ void handle_cmdline_completion(std::shared_ptr<formaction> fa);
+ void clear_line(std::shared_ptr<formaction> fa);
+ void clear_eol(std::shared_ptr<formaction> fa);
+ void cancel_input(std::shared_ptr<formaction> fa);
+ void delete_word(std::shared_ptr<formaction> fa);
controller * ctrl;
@@ -123,7 +123,7 @@
friend class colormanager;
- std::vector<std::tr1::shared_ptr<formaction> > formaction_stack;
+ std::vector<std::shared_ptr<formaction> > formaction_stack;
unsigned int current_formaction;
std::vector<std::string> tags;
diff -Naur newsbeuter-2.8/rss/parser.cpp newsbeuter-2.8-m/rss/parser.cpp
--- newsbeuter-2.8/rss/parser.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/rss/parser.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -257,7 +257,7 @@
}
}
- std::tr1::shared_ptr<rss_parser> parser = rss_parser_factory::get_object(f, doc);
+ std::shared_ptr<rss_parser> parser = rss_parser_factory::get_object(f, doc);
try {
parser->parse_feed(f, node);
diff -Naur newsbeuter-2.8/rss/parser_factory.cpp newsbeuter-2.8-m/rss/parser_factory.cpp
--- newsbeuter-2.8/rss/parser_factory.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/rss/parser_factory.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -8,20 +8,20 @@
namespace rsspp {
-std::tr1::shared_ptr<rss_parser> rss_parser_factory::get_object(feed& f, xmlDocPtr doc) {
+std::shared_ptr<rss_parser> rss_parser_factory::get_object(feed& f, xmlDocPtr doc) {
switch (f.rss_version) {
case RSS_0_91:
case RSS_0_92:
case RSS_0_94:
- return std::tr1::shared_ptr<rss_parser>(new rss_09x_parser(doc));
+ return std::shared_ptr<rss_parser>(new rss_09x_parser(doc));
case RSS_2_0:
- return std::tr1::shared_ptr<rss_parser>(new rss_20_parser(doc));
+ return std::shared_ptr<rss_parser>(new rss_20_parser(doc));
case RSS_1_0:
- return std::tr1::shared_ptr<rss_parser>(new rss_10_parser(doc));
+ return std::shared_ptr<rss_parser>(new rss_10_parser(doc));
case ATOM_0_3:
case ATOM_0_3_NONS:
case ATOM_1_0:
- return std::tr1::shared_ptr<rss_parser>(new atom_parser(doc));
+ return std::shared_ptr<rss_parser>(new atom_parser(doc));
case UNKNOWN:
default:
throw exception(_("unsupported feed format"));
diff -Naur newsbeuter-2.8/rss/rsspp_internal.h newsbeuter-2.8-m/rss/rsspp_internal.h
--- newsbeuter-2.8/rss/rsspp_internal.h 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/rss/rsspp_internal.h 2014-02-02 12:41:26.000000000 +0800
@@ -69,7 +69,7 @@
};
struct rss_parser_factory {
- static std::tr1::shared_ptr<rss_parser> get_object(feed& f, xmlDocPtr doc);
+ static std::shared_ptr<rss_parser> get_object(feed& f, xmlDocPtr doc);
};
}
diff -Naur newsbeuter-2.8/src/cache.cpp newsbeuter-2.8-m/src/cache.cpp
--- newsbeuter-2.8/src/cache.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/cache.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -52,7 +52,7 @@
}
static int rssfeed_callback(void * myfeed, int argc, char ** argv, char ** /* azColName */) {
- std::tr1::shared_ptr<rss_feed>* feed = static_cast<std::tr1::shared_ptr<rss_feed>* >(myfeed);
+ std::shared_ptr<rss_feed>* feed = static_cast<std::shared_ptr<rss_feed>* >(myfeed);
// normaly, this shouldn't happen, but we keep the assert()s here nevertheless
assert(argc == 3);
assert(argv[0] != NULL);
@@ -94,9 +94,9 @@
}
static int rssitem_callback(void * myfeed, int argc, char ** argv, char ** /* azColName */) {
- std::tr1::shared_ptr<rss_feed>* feed = static_cast<std::tr1::shared_ptr<rss_feed>* >(myfeed);
+ std::shared_ptr<rss_feed>* feed = static_cast<std::shared_ptr<rss_feed>* >(myfeed);
assert (argc == 13);
- std::tr1::shared_ptr<rss_item> item(new rss_item(NULL));
+ std::shared_ptr<rss_item> item(new rss_item(NULL));
item->set_guid(argv[0]);
item->set_title(argv[1]);
item->set_author(argv[2]);
@@ -127,16 +127,16 @@
rss_feed * feed = static_cast<rss_feed *>(myfeed);
assert(argc == 2);
if (argv[0]) {
- std::tr1::shared_ptr<rss_item> item = feed->get_item_by_guid_unlocked(argv[0]);
+ std::shared_ptr<rss_item> item = feed->get_item_by_guid_unlocked(argv[0]);
item->set_description(argv[1] ? argv[1] : "");
}
return 0;
}
static int search_item_callback(void * myfeed, int argc, char ** argv, char ** /* azColName */) {
- std::vector<std::tr1::shared_ptr<rss_item> > * items = static_cast<std::vector<std::tr1::shared_ptr<rss_item> > *>(myfeed);
+ std::vector<std::shared_ptr<rss_item> > * items = static_cast<std::vector<std::shared_ptr<rss_item> > *>(myfeed);
assert (argc == 13);
- std::tr1::shared_ptr<rss_item> item(new rss_item(NULL));
+ std::shared_ptr<rss_item> item(new rss_item(NULL));
item->set_guid(argv[0]);
item->set_title(argv[1]);
item->set_author(argv[2]);
@@ -337,7 +337,7 @@
// this function writes an rss_feed including all rss_items to the database
-void cache::externalize_rssfeed(std::tr1::shared_ptr<rss_feed> feed, bool reset_unread) {
+void cache::externalize_rssfeed(std::shared_ptr<rss_feed> feed, bool reset_unread) {
scope_measure m1("cache::externalize_feed");
if (feed->rssurl().substr(0,6) == "query:")
return;
@@ -372,7 +372,7 @@
LOG(LOG_INFO, "cache::externalize_feed: max_items = %u feed.items().size() = %u", max_items, feed->total_item_count());
if (max_items > 0 && feed->items().size() > max_items) {
- std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=feed->items().begin();
+ std::vector<std::shared_ptr<rss_item> >::iterator it=feed->items().begin();
for (unsigned int i=0;i<max_items;++i)
++it;
if (it != feed->items().end())
@@ -383,7 +383,7 @@
time_t old_time = time(NULL) - days * 24*60*60;
// the reverse iterator is there for the sorting foo below (think about it)
- for (std::vector<std::tr1::shared_ptr<rss_item> >::reverse_iterator it=feed->items().rbegin(); it != feed->items().rend(); ++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::reverse_iterator it=feed->items().rbegin(); it != feed->items().rend(); ++it) {
if (days == 0 || (*it)->pubDate_timestamp() >= old_time)
update_rssitem_unlocked(*it, feed->rssurl(), reset_unread);
}
@@ -391,7 +391,7 @@
// this function reads an rss_feed including all of its rss_items.
// the feed parameter needs to have the rssurl member set.
-void cache::internalize_rssfeed(std::tr1::shared_ptr<rss_feed> feed, rss_ignores * ign) {
+void cache::internalize_rssfeed(std::shared_ptr<rss_feed> feed, rss_ignores * ign) {
scope_measure m1("cache::internalize_rssfeed");
if (feed->rssurl().substr(0,6) == "query:")
return;
@@ -434,7 +434,7 @@
}
unsigned int i=0;
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=feed->items().begin(); it != feed->items().end(); ++it,++i) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=feed->items().begin(); it != feed->items().end(); ++it,++i) {
(*it)->set_cache(this);
(*it)->set_feedptr(feed);
(*it)->set_feedurl(feed->rssurl());
@@ -456,8 +456,8 @@
unsigned int max_items = cfg->get_configvalue_as_int("max-items");
if (max_items > 0 && feed->items().size() > max_items) {
- std::vector<std::tr1::shared_ptr<rss_item> > flagged_items;
- std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=feed->items().begin();
+ std::vector<std::shared_ptr<rss_item> > flagged_items;
+ std::vector<std::shared_ptr<rss_item> >::iterator it=feed->items().begin();
for (unsigned int i=0;i<max_items;++i)
++it;
for (unsigned int i=max_items;i<feed->items().size();++i) {
@@ -470,7 +470,7 @@
feed->erase_items(it, feed->items().end()); // delete old entries
if (flagged_items.size() > 0) {
// if some flagged articles were saved, append them
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator jt=flagged_items.begin();jt!=flagged_items.end();++jt) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator jt=flagged_items.begin();jt!=flagged_items.end();++jt) {
feed->add_item(*jt);
}
}
@@ -479,9 +479,9 @@
}
-std::vector<std::tr1::shared_ptr<rss_item> > cache::search_for_items(const std::string& querystr, const std::string& feedurl) {
+std::vector<std::shared_ptr<rss_item> > cache::search_for_items(const std::string& querystr, const std::string& feedurl) {
std::string query;
- std::vector<std::tr1::shared_ptr<rss_item> > items;
+ std::vector<std::shared_ptr<rss_item> > items;
int rc;
scope_mutex lock(&mtx);
@@ -502,7 +502,7 @@
return items;
}
-void cache::delete_item(const std::tr1::shared_ptr<rss_item> item) {
+void cache::delete_item(const std::shared_ptr<rss_item> item) {
std::string query = prepare_query("DELETE FROM rss_item WHERE guid = '%q';",item->guid().c_str());
LOG(LOG_DEBUG,"running query: %s",query.c_str());
int rc = sqlite3_exec(db,query.c_str(),NULL,NULL,NULL);
@@ -521,7 +521,7 @@
}
}
-void cache::cleanup_cache(std::vector<std::tr1::shared_ptr<rss_feed> >& feeds) {
+void cache::cleanup_cache(std::vector<std::shared_ptr<rss_feed> >& feeds) {
mtx.lock(); // we don't use the scope_mutex here... see comments below
/*
@@ -540,7 +540,7 @@
unsigned int i = 0;
unsigned int feed_size = feeds.size();
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it,++i) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it,++i) {
std::string name = prepare_query("'%q'",(*it)->rssurl().c_str());
list.append(name);
if (i < feed_size-1) {
@@ -592,7 +592,7 @@
}
}
-void cache::update_rssitem_unlocked(std::tr1::shared_ptr<rss_item> item, const std::string& feedurl, bool reset_unread) {
+void cache::update_rssitem_unlocked(std::shared_ptr<rss_item> item, const std::string& feedurl, bool reset_unread) {
std::string query = prepare_query("SELECT count(*) FROM rss_item WHERE guid = '%q';",item->guid().c_str());
cb_handler count_cbh;
LOG(LOG_DEBUG,"running query: %s", query.c_str());
@@ -656,12 +656,12 @@
}
}
-void cache::catchup_all(std::tr1::shared_ptr<rss_feed> feed) {
+void cache::catchup_all(std::shared_ptr<rss_feed> feed) {
scope_mutex lock(&mtx);
scope_mutex feedlock(&feed->item_mutex);
std::string query = "UPDATE rss_item SET unread = '0' WHERE unread != '0' AND guid IN (";
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=feed->items().begin();it!=feed->items().end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=feed->items().begin();it!=feed->items().end();++it) {
query.append(prepare_query("'%q',", (*it)->guid().c_str()));
}
query.append("'');");
@@ -730,7 +730,7 @@
}
/* this function updates the unread and enqueued flags */
-void cache::update_rssitem_unread_and_enqueued(std::tr1::shared_ptr<rss_item> item, const std::string& feedurl) {
+void cache::update_rssitem_unread_and_enqueued(std::shared_ptr<rss_item> item, const std::string& feedurl) {
scope_mutex lock(&mtx);
std::string query = prepare_query("SELECT count(*) FROM rss_item WHERE guid = '%q';",item->guid().c_str());
@@ -886,9 +886,9 @@
}
void cache::fetch_descriptions(rss_feed * feed) {
- std::vector<std::tr1::shared_ptr<rss_item> >& items = feed->items();
+ std::vector<std::shared_ptr<rss_item> >& items = feed->items();
std::vector<std::string> guids;
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=items.begin();it!=items.end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=items.begin();it!=items.end();++it) {
guids.push_back(prepare_query("'%q'", (*it)->guid().c_str()));
}
std::string in_clause = utils::join(guids, ", ");
diff -Naur newsbeuter-2.8/src/controller.cpp newsbeuter-2.8-m/src/controller.cpp
--- newsbeuter-2.8/src/controller.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/controller.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -190,7 +190,7 @@
delete api;
scope_mutex feedslock(&feeds_mutex);
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
scope_mutex lock(&((*it)->item_mutex));
(*it)->clear_items();
}
@@ -518,7 +518,7 @@
unsigned int i=0;
for (std::vector<std::string>::const_iterator it=urlcfg->get_urls().begin(); it != urlcfg->get_urls().end(); ++it, ++i) {
- std::tr1::shared_ptr<rss_feed> feed(new rss_feed(rsscache));
+ std::shared_ptr<rss_feed> feed(new rss_feed(rsscache));
try {
feed->set_rssurl(*it);
feed->set_tags(urlcfg->get_tags(*it));
@@ -550,7 +550,7 @@
std::cout << _("Prepopulating query feeds...");
std::cout.flush();
scope_mutex feedslock(&feeds_mutex);
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
if ((*it)->rssurl().substr(0,6) == "query:") {
(*it)->update_items(get_all_feeds_unlocked());
}
@@ -646,13 +646,13 @@
return;
}
scope_mutex feedslock(&feeds_mutex);
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
scope_mutex lock(&(*it)->item_mutex);
if ((*it)->items().size() > 0) {
if (api) {
api->mark_all_read((*it)->rssurl());
}
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator jt=(*it)->items().begin();jt!=(*it)->items().end();++jt) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator jt=(*it)->items().begin();jt!=(*it)->items().end();++jt) {
(*jt)->set_unread_nowrite(false);
}
}
@@ -678,7 +678,7 @@
if (pos < feeds.size()) {
scope_measure m("controller::mark_all_read");
scope_mutex feedslock(&feeds_mutex);
- std::tr1::shared_ptr<rss_feed> feed = feeds[pos];
+ std::shared_ptr<rss_feed> feed = feeds[pos];
if (feed->rssurl().substr(0,6) == "query:") {
rsscache->catchup_all(feed);
} else {
@@ -689,12 +689,12 @@
}
m.stopover("after rsscache->catchup_all, before iteration over items");
scope_mutex lock(&feed->item_mutex);
- std::vector<std::tr1::shared_ptr<rss_item> >& items = feed->items();
- std::vector<std::tr1::shared_ptr<rss_item> >::iterator begin = items.begin(), end = items.end();
+ std::vector<std::shared_ptr<rss_item> >& items = feed->items();
+ std::vector<std::shared_ptr<rss_item> >::iterator begin = items.begin(), end = items.end();
if (items.size() > 0) {
bool notify = items[0]->feedurl() != feed->rssurl();
LOG(LOG_DEBUG, "controller::mark_all_read: notify = %s", notify ? "yes" : "no");
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=begin;it!=end;++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=begin;it!=end;++it) {
(*it)->set_unread_nowrite_notify(false, notify);
}
}
@@ -704,7 +704,7 @@
void controller::reload(unsigned int pos, unsigned int max, bool unattended, curl_handle *easyhandle) {
LOG(LOG_DEBUG, "controller::reload: pos = %u max = %u", pos, max);
if (pos < feeds.size()) {
- std::tr1::shared_ptr<rss_feed> oldfeed = feeds[pos];
+ std::shared_ptr<rss_feed> oldfeed = feeds[pos];
std::string errmsg;
if (!unattended)
v->set_status(utils::strprintf(_("%sLoading %s..."), prepare_message(pos+1, max).c_str(), utils::censor_url(oldfeed->rssurl()).c_str()));
@@ -716,7 +716,7 @@
LOG(LOG_DEBUG, "controller::reload: created parser");
try {
oldfeed->set_status(DURING_DOWNLOAD);
- std::tr1::shared_ptr<rss_feed> newfeed = parser.parse();
+ std::shared_ptr<rss_feed> newfeed = parser.parse();
if (newfeed->items().size() > 0) {
scope_mutex feedslock(&feeds_mutex);
save_feed(newfeed, pos);
@@ -746,12 +746,12 @@
}
}
-std::tr1::shared_ptr<rss_feed> controller::get_feed(unsigned int pos) {
+std::shared_ptr<rss_feed> controller::get_feed(unsigned int pos) {
scope_mutex feedslock(&feeds_mutex);
if (pos >= feeds.size()) {
throw std::out_of_range(_("invalid feed index (bug)"));
}
- std::tr1::shared_ptr<rss_feed> feed = feeds[pos];
+ std::shared_ptr<rss_feed> feed = feeds[pos];
return feed;
}
@@ -786,8 +786,8 @@
}
struct feed_cmp {
- const std::vector<std::tr1::shared_ptr<rss_feed> > &feeds;
- feed_cmp(const std::vector<std::tr1::shared_ptr<rss_feed> > &f)
+ const std::vector<std::shared_ptr<rss_feed> > &feeds;
+ feed_cmp(const std::vector<std::shared_ptr<rss_feed> > &f)
: feeds(f)
{
}
@@ -801,8 +801,8 @@
}
bool operator()(unsigned a, unsigned b) const
{
- std::tr1::shared_ptr<rss_feed> x = feeds[a];
- std::tr1::shared_ptr<rss_feed> y = feeds[b];
+ std::shared_ptr<rss_feed> x = feeds[a];
+ std::shared_ptr<rss_feed> y = feeds[b];
const std::string &u = x->rssurl();
const std::string &v = y->rssurl();
@@ -840,7 +840,7 @@
{
scope_mutex feedlock(&feeds_mutex);
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
(*it)->reset_status();
}
size = feeds.size();
@@ -877,7 +877,7 @@
// refresh query feeds (update and sort)
LOG(LOG_DEBUG, "controller::reload_all: refresh query feeds");
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
v->prepare_query_feed(*it);
}
v->force_redraw();
@@ -933,7 +933,7 @@
void controller::compute_unread_numbers(unsigned int& unread_feeds, unsigned int& unread_articles) {
unread_feeds = 0;
unread_articles = 0;
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
unsigned int items = (*it)->unread_item_count();
if (items > 0) {
++unread_feeds;
@@ -1060,7 +1060,7 @@
xmlNewTextChild(head, NULL, (const xmlChar *)"title", (const xmlChar *)PROGRAM_NAME " - Exported Feeds");
xmlNodePtr body = xmlNewTextChild(opml_node, NULL, (const xmlChar *)"body", NULL);
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin(); it != feeds.end(); ++it) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin(); it != feeds.end(); ++it) {
if (!utils::is_special_url((*it)->rssurl())) {
std::string rssurl = (*it)->rssurl();
std::string link = (*it)->link();
@@ -1160,28 +1160,28 @@
-std::vector<std::tr1::shared_ptr<rss_item> > controller::search_for_items(const std::string& query, const std::string& feedurl) {
- std::vector<std::tr1::shared_ptr<rss_item> > items = rsscache->search_for_items(query, feedurl);
+std::vector<std::shared_ptr<rss_item> > controller::search_for_items(const std::string& query, const std::string& feedurl) {
+ std::vector<std::shared_ptr<rss_item> > items = rsscache->search_for_items(query, feedurl);
LOG(LOG_DEBUG, "controller::search_for_items: setting feed pointers");
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=items.begin();it!=items.end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=items.begin();it!=items.end();++it) {
(*it)->set_feedptr(get_feed_by_url((*it)->feedurl()));
}
return items;
}
-std::tr1::shared_ptr<rss_feed> controller::get_feed_by_url(const std::string& feedurl) {
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
+std::shared_ptr<rss_feed> controller::get_feed_by_url(const std::string& feedurl) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
if (feedurl == (*it)->rssurl())
return *it;
}
- return std::tr1::shared_ptr<rss_feed>();
+ return std::shared_ptr<rss_feed>();
}
bool controller::is_valid_podcast_type(const std::string& /* mimetype */) {
return true;
}
-void controller::enqueue_url(const std::string& url, std::tr1::shared_ptr<rss_feed> feed) {
+void controller::enqueue_url(const std::string& url, std::shared_ptr<rss_feed> feed) {
bool url_found = false;
std::fstream f;
f.open(queue_file.c_str(), std::fstream::in);
@@ -1209,12 +1209,12 @@
void controller::reload_urls_file() {
urlcfg->reload();
- std::vector<std::tr1::shared_ptr<rss_feed> > new_feeds;
+ std::vector<std::shared_ptr<rss_feed> > new_feeds;
unsigned int i = 0;
for (std::vector<std::string>::const_iterator it=urlcfg->get_urls().begin();it!=urlcfg->get_urls().end();++it,++i) {
bool found = false;
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator jt=feeds.begin();jt!=feeds.end();++jt) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator jt=feeds.begin();jt!=feeds.end();++jt) {
if (*it == (*jt)->rssurl()) {
found = true;
(*jt)->set_tags(urlcfg->get_tags(*it));
@@ -1224,7 +1224,7 @@
}
}
if (!found) {
- std::tr1::shared_ptr<rss_feed> new_feed(new rss_feed(rsscache));
+ std::shared_ptr<rss_feed> new_feed(new rss_feed(rsscache));
try {
new_feed->set_rssurl(*it);
} catch (const std::string& str) {
@@ -1322,7 +1322,7 @@
}
}
-std::string controller::write_temporary_item(std::tr1::shared_ptr<rss_item> item) {
+std::string controller::write_temporary_item(std::shared_ptr<rss_item> item) {
char filename[1024];
snprintf(filename, sizeof(filename), "/tmp/newsbeuter-article.XXXXXX");
int fd = mkstemp(filename);
@@ -1335,7 +1335,7 @@
}
}
-void controller::write_item(std::tr1::shared_ptr<rss_item> item, const std::string& filename) {
+void controller::write_item(std::shared_ptr<rss_item> item, const std::string& filename) {
std::fstream f;
f.open(filename.c_str(),std::fstream::out);
if (!f.is_open())
@@ -1344,7 +1344,7 @@
write_item(item, f);
}
-void controller::write_item(std::tr1::shared_ptr<rss_item> item, std::ostream& ostr) {
+void controller::write_item(std::shared_ptr<rss_item> item, std::ostream& ostr) {
std::vector<std::string> lines;
std::vector<linkpair> links; // not used
@@ -1394,7 +1394,7 @@
return "";
}
-void controller::save_feed(std::tr1::shared_ptr<rss_feed> feed, unsigned int pos) {
+void controller::save_feed(std::shared_ptr<rss_feed> feed, unsigned int pos) {
if (!feed->is_empty()) {
LOG(LOG_DEBUG, "controller::save_feed: feed is nonempty, saving");
rsscache->externalize_rssfeed(feed, ign.matches_resetunread(feed->rssurl()));
@@ -1412,11 +1412,11 @@
}
}
-void controller::enqueue_items(std::tr1::shared_ptr<rss_feed> feed) {
+void controller::enqueue_items(std::shared_ptr<rss_feed> feed) {
if (!cfg.get_configvalue_as_bool("podcast-auto-enqueue"))
return;
scope_mutex lock(&feed->item_mutex);
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=feed->items().begin();it!=feed->items().end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=feed->items().begin();it!=feed->items().end();++it) {
if (!(*it)->enqueued() && (*it)->enclosure_url().length() > 0) {
LOG(LOG_DEBUG, "controller::enqueue_items: enclosure_url = `%s' enclosure_type = `%s'", (*it)->enclosure_url().c_str(), (*it)->enclosure_type().c_str());
if (is_valid_podcast_type((*it)->enclosure_type()) && utils::is_http_url((*it)->enclosure_url())) {
@@ -1429,7 +1429,7 @@
}
}
-std::string controller::generate_enqueue_filename(const std::string& url, std::tr1::shared_ptr<rss_feed> feed) {
+std::string controller::generate_enqueue_filename(const std::string& url, std::shared_ptr<rss_feed> feed) {
std::string dlformat = cfg.get_configvalue("download-path");
if (dlformat[dlformat.length()-1] != NEWSBEUTER_PATH_SEP[0])
dlformat.append(NEWSBEUTER_PATH_SEP);
@@ -1492,9 +1492,9 @@
}
}
-struct sort_feeds_by_firsttag : public std::binary_function<std::tr1::shared_ptr<rss_feed>, std::tr1::shared_ptr<rss_feed>, bool> {
+struct sort_feeds_by_firsttag : public std::binary_function<std::shared_ptr<rss_feed>, std::shared_ptr<rss_feed>, bool> {
sort_feeds_by_firsttag() { }
- bool operator()(std::tr1::shared_ptr<rss_feed> a, std::tr1::shared_ptr<rss_feed> b) {
+ bool operator()(std::shared_ptr<rss_feed> a, std::shared_ptr<rss_feed> b) {
if (a->get_firsttag().length() == 0 || b->get_firsttag().length() == 0) {
return a->get_firsttag().length() > b->get_firsttag().length();
}
@@ -1502,30 +1502,30 @@
}
};
-struct sort_feeds_by_title : public std::binary_function<std::tr1::shared_ptr<rss_feed>, std::tr1::shared_ptr<rss_feed>, bool> {
+struct sort_feeds_by_title : public std::binary_function<std::shared_ptr<rss_feed>, std::shared_ptr<rss_feed>, bool> {
sort_feeds_by_title() { }
- bool operator()(std::tr1::shared_ptr<rss_feed> a, std::tr1::shared_ptr<rss_feed> b) {
+ bool operator()(std::shared_ptr<rss_feed> a, std::shared_ptr<rss_feed> b) {
return strcasecmp(a->title().c_str(), b->title().c_str()) < 0;
}
};
-struct sort_feeds_by_articles : public std::binary_function<std::tr1::shared_ptr<rss_feed>, std::tr1::shared_ptr<rss_feed>, bool> {
+struct sort_feeds_by_articles : public std::binary_function<std::shared_ptr<rss_feed>, std::shared_ptr<rss_feed>, bool> {
sort_feeds_by_articles() { }
- bool operator()(std::tr1::shared_ptr<rss_feed> a, std::tr1::shared_ptr<rss_feed> b) {
+ bool operator()(std::shared_ptr<rss_feed> a, std::shared_ptr<rss_feed> b) {
return a->total_item_count() < b->total_item_count();
}
};
-struct sort_feeds_by_unread_articles : public std::binary_function<std::tr1::shared_ptr<rss_feed>, std::tr1::shared_ptr<rss_feed>, bool> {
+struct sort_feeds_by_unread_articles : public std::binary_function<std::shared_ptr<rss_feed>, std::shared_ptr<rss_feed>, bool> {
sort_feeds_by_unread_articles() { }
- bool operator()(std::tr1::shared_ptr<rss_feed> a, std::tr1::shared_ptr<rss_feed> b) {
+ bool operator()(std::shared_ptr<rss_feed> a, std::shared_ptr<rss_feed> b) {
return a->unread_item_count() < b->unread_item_count();
}
};
-struct sort_feeds_by_order : public std::binary_function<std::tr1::shared_ptr<rss_feed>, std::tr1::shared_ptr<rss_feed>, bool> {
+struct sort_feeds_by_order : public std::binary_function<std::shared_ptr<rss_feed>, std::shared_ptr<rss_feed>, bool> {
sort_feeds_by_order() { }
- bool operator()(std::tr1::shared_ptr<rss_feed> a, std::tr1::shared_ptr<rss_feed> b) {
+ bool operator()(std::shared_ptr<rss_feed> a, std::shared_ptr<rss_feed> b) {
return a->get_order() < b->get_order();
}
};
@@ -1605,15 +1605,15 @@
return pos;
}
-void controller::update_flags(std::tr1::shared_ptr<rss_item> item) {
+void controller::update_flags(std::shared_ptr<rss_item> item) {
if (api) {
api->update_article_flags(item->oldflags(), item->flags(), item->guid());
}
item->update_flags();
}
-std::vector<std::tr1::shared_ptr<rss_feed> > controller::get_all_feeds() {
- std::vector<std::tr1::shared_ptr<rss_feed> > tmpfeeds;
+std::vector<std::shared_ptr<rss_feed> > controller::get_all_feeds() {
+ std::vector<std::shared_ptr<rss_feed> > tmpfeeds;
{
scope_mutex feedslock(&feeds_mutex);
tmpfeeds = feeds;
@@ -1621,7 +1621,7 @@
return tmpfeeds;
}
-std::vector<std::tr1::shared_ptr<rss_feed> > controller::get_all_feeds_unlocked() {
+std::vector<std::shared_ptr<rss_feed> > controller::get_all_feeds_unlocked() {
return feeds;
}
@@ -1630,7 +1630,7 @@
unsigned int count = 0;
scope_mutex feedslock(&feeds_mutex);
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::const_iterator it=feeds.begin();it!=feeds.end();it++) {
+ for (std::vector<std::shared_ptr<rss_feed> >::const_iterator it=feeds.begin();it!=feeds.end();it++) {
if ((*it)->matches_tag(tag)) {
count++;
}
diff -Naur newsbeuter-2.8/src/feedlist_formaction.cpp newsbeuter-2.8-m/src/feedlist_formaction.cpp
--- newsbeuter-2.8/src/feedlist_formaction.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/feedlist_formaction.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -159,7 +159,7 @@
break;
case OP_OPENINBROWSER:
if (feeds_shown > 0 && feedpos.length() > 0) {
- std::tr1::shared_ptr<rss_feed> feed = v->get_ctrl()->get_feed(pos);
+ std::shared_ptr<rss_feed> feed = v->get_ctrl()->get_feed(pos);
if (feed) {
LOG(LOG_INFO, "feedlist_formaction: opening feed at position `%s': %s", feedpos.c_str(), feed->link().c_str());
v->open_in_browser(feed->link());
@@ -365,14 +365,14 @@
}
}
-void feedlist_formaction::update_visible_feeds(std::vector<std::tr1::shared_ptr<rss_feed> >& feeds) {
+void feedlist_formaction::update_visible_feeds(std::vector<std::shared_ptr<rss_feed> >& feeds) {
assert(v->get_cfg() != NULL); // must not happen
visible_feeds.clear();
unsigned int i = 0;
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it = feeds.begin(); it != feeds.end(); ++it, ++i) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it = feeds.begin(); it != feeds.end(); ++it, ++i) {
(*it)->set_index(i+1);
if ((tag == "" || (*it)->matches_tag(tag)) && (!apply_filter || m.matches(it->get())) && !(*it)->hidden()) {
visible_feeds.push_back(feedptr_pos_pair(*it,i));
@@ -382,7 +382,7 @@
feeds_shown = visible_feeds.size();
}
-void feedlist_formaction::set_feedlist(std::vector<std::tr1::shared_ptr<rss_feed> >& feeds) {
+void feedlist_formaction::set_feedlist(std::vector<std::shared_ptr<rss_feed> >& feeds) {
assert(v->get_cfg() != NULL); // must not happen
unsigned int width = utils::to_u(f->get("feeds:w"));
@@ -579,7 +579,7 @@
return false;
}
-std::tr1::shared_ptr<rss_feed> feedlist_formaction::get_feed() {
+std::shared_ptr<rss_feed> feedlist_formaction::get_feed() {
unsigned int curpos;
std::istringstream is(f->get("feedpos"));
is >> curpos;
@@ -709,7 +709,7 @@
if (searchphrase.length() > 0) {
v->set_status(_("Searching..."));
searchhistory.add_line(searchphrase);
- std::vector<std::tr1::shared_ptr<rss_item> > items;
+ std::vector<std::shared_ptr<rss_item> > items;
try {
std::string utf8searchphrase = utils::convert_text(searchphrase, "utf-8", nl_langinfo(CODESET));
items = v->get_ctrl()->search_for_items(utf8searchphrase, "");
@@ -720,7 +720,7 @@
if (!items.empty()) {
search_dummy_feed->item_mutex.lock();
search_dummy_feed->clear_items();
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=items.begin();it!=items.end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=items.begin();it!=items.end();++it) {
search_dummy_feed->add_item(*it);
}
search_dummy_feed->item_mutex.unlock();
@@ -761,7 +761,7 @@
}
}
-std::string feedlist_formaction::get_title(std::tr1::shared_ptr<rss_feed> feed) {
+std::string feedlist_formaction::get_title(std::shared_ptr<rss_feed> feed) {
std::string title = feed->title();
if (title.length()==0)
title = utils::censor_url(feed->rssurl());
@@ -770,7 +770,7 @@
return title;
}
-std::string feedlist_formaction::format_line(const std::string& feedlist_format, std::tr1::shared_ptr<rss_feed> feed, unsigned int pos, unsigned int width) {
+std::string feedlist_formaction::format_line(const std::string& feedlist_format, std::shared_ptr<rss_feed> feed, unsigned int pos, unsigned int width) {
fmtstr_formatter fmt;
unsigned int unread_count = feed->unread_item_count();
diff -Naur newsbeuter-2.8/src/formaction.cpp newsbeuter-2.8-m/src/formaction.cpp
--- newsbeuter-2.8/src/formaction.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/formaction.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -43,7 +43,7 @@
formaction::~formaction() { }
-std::tr1::shared_ptr<stfl::form> formaction::get_form() {
+std::shared_ptr<stfl::form> formaction::get_form() {
return f;
}
diff -Naur newsbeuter-2.8/src/itemlist_formaction.cpp newsbeuter-2.8-m/src/itemlist_formaction.cpp
--- newsbeuter-2.8/src/itemlist_formaction.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/itemlist_formaction.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -320,7 +320,7 @@
{
scope_mutex lock(&feed->item_mutex);
LOG(LOG_DEBUG, "itemlist_formaction: oh, it looks like I'm in a pseudo-feed (search result, query feed)");
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=feed->items().begin();it!=feed->items().end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=feed->items().begin();it!=feed->items().end();++it) {
(*it)->set_unread_nowrite_notify(false, true); // TODO: do we need to call mark_article_read here, too?
}
}
@@ -574,7 +574,7 @@
v->set_status(_("Searching..."));
searchhistory.add_line(searchphrase);
- std::vector<std::tr1::shared_ptr<rss_item> > items;
+ std::vector<std::shared_ptr<rss_item> > items;
try {
std::string utf8searchphrase = utils::convert_text(searchphrase, "utf-8", nl_langinfo(CODESET));
if (show_searchresult) {
@@ -595,7 +595,7 @@
{
scope_mutex lock(&search_dummy_feed->item_mutex);
search_dummy_feed->clear_items();
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=items.begin();it!=items.end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=items.begin();it!=items.end();++it) {
search_dummy_feed->add_item(*it);
}
}
@@ -613,7 +613,7 @@
update_visible_items = false;
scope_mutex lock(&feed->item_mutex);
- std::vector<std::tr1::shared_ptr<rss_item> >& items = feed->items();
+ std::vector<std::shared_ptr<rss_item> >& items = feed->items();
std::vector<itemptr_pos_pair> new_visible_items;
@@ -624,7 +624,7 @@
*/
unsigned int i=0;
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it = items.begin(); it != items.end(); ++it, ++i) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it = items.begin(); it != items.end(); ++it, ++i) {
(*it)->set_index(i+1);
if (!apply_filter || m.matches(it->get())) {
new_visible_items.push_back(itemptr_pos_pair(*it, i));
@@ -953,7 +953,7 @@
}
}
-void itemlist_formaction::save_article(const std::string& filename, std::tr1::shared_ptr<rss_item> item) {
+void itemlist_formaction::save_article(const std::string& filename, std::shared_ptr<rss_item> item) {
if (filename == "") {
v->show_error(_("Aborted saving."));
} else {
@@ -989,7 +989,7 @@
f->modify("items", "replace", textview);
}
-std::string itemlist_formaction::gen_flags(std::tr1::shared_ptr<rss_item> item) {
+std::string itemlist_formaction::gen_flags(std::shared_ptr<rss_item> item) {
std::string flags;
if (item->deleted()) {
flags.append("D");
@@ -1027,7 +1027,7 @@
}
}
-void itemlist_formaction::set_feed(std::tr1::shared_ptr<rss_feed> fd) {
+void itemlist_formaction::set_feed(std::shared_ptr<rss_feed> fd) {
LOG(LOG_DEBUG, "itemlist_formaction::set_feed: fd pointer = %p title = `%s'", fd.get(), fd->title().c_str());
feed = fd;
feed->load();
diff -Naur newsbeuter-2.8/src/itemview_formaction.cpp newsbeuter-2.8-m/src/itemview_formaction.cpp
--- newsbeuter-2.8/src/itemview_formaction.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/itemview_formaction.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -13,7 +13,7 @@
namespace newsbeuter {
-itemview_formaction::itemview_formaction(view * vv, std::tr1::shared_ptr<itemlist_formaction> il, std::string formstr)
+itemview_formaction::itemview_formaction(view * vv, std::shared_ptr<itemlist_formaction> il, std::string formstr)
: formaction(vv,formstr), show_source(false), quit(false), rxman(0), num_lines(0), itemlist(il), in_search(false) {
valid_cmds.push_back("save");
std::sort(valid_cmds.begin(), valid_cmds.end());
@@ -62,10 +62,10 @@
}
LOG(LOG_DEBUG, "itemview_formaction::prepare: guid = %s", guid.c_str());
- std::tr1::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
+ std::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
listformatter listfmt;
- std::tr1::shared_ptr<rss_feed> feedptr = item->get_feedptr();
+ std::shared_ptr<rss_feed> feedptr = item->get_feedptr();
std::string title, feedtitle;
if (feedptr.get() != NULL) {
@@ -151,7 +151,7 @@
}
void itemview_formaction::process_operation(operation op, bool automatic, std::vector<std::string> * args) {
- std::tr1::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
+ std::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
bool hardquit = false;
/*
@@ -469,7 +469,7 @@
if (!tokens.empty()) {
if (tokens[0] == "save" && tokens.size() >= 2) {
std::string filename = utils::resolve_tilde(tokens[1]);
- std::tr1::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
+ std::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
if (filename == "") {
v->show_error(_("Aborted saving."));
@@ -491,7 +491,7 @@
void itemview_formaction::finished_qna(operation op) {
formaction::finished_qna(op); // important!
- std::tr1::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
+ std::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
switch (op) {
case OP_INT_EDITFLAGS_END:
@@ -598,7 +598,7 @@
}
std::string itemview_formaction::title() {
- std::tr1::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
+ std::shared_ptr<rss_item> item = feed->get_item_by_guid(guid);
return utils::strprintf(_("Article - %s"), item->title().c_str());
}
diff -Naur newsbeuter-2.8/src/regexmanager.cpp newsbeuter-2.8-m/src/regexmanager.cpp
--- newsbeuter-2.8/src/regexmanager.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/regexmanager.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -133,7 +133,7 @@
}
}
- std::tr1::shared_ptr<matcher> m(new matcher());
+ std::shared_ptr<matcher> m(new matcher());
if (!m->parse(params[0])) {
throw confighandlerexception(utils::strprintf(_("couldn't parse filter expression `%s': %s"), params[0].c_str(), m->get_parse_error().c_str()));
}
@@ -143,14 +143,14 @@
locations["articlelist"].first.push_back(NULL);
locations["articlelist"].second.push_back(colorstr);
- matchers.push_back(std::pair<std::tr1::shared_ptr<matcher>, int>(m, pos));
+ matchers.push_back(std::pair<std::shared_ptr<matcher>, int>(m, pos));
} else
throw confighandlerexception(AHS_INVALID_COMMAND);
}
int regexmanager::article_matches(matchable * item) {
- for (std::vector<std::pair<std::tr1::shared_ptr<matcher>, int> >::iterator it=matchers.begin();it!=matchers.end();++it) {
+ for (std::vector<std::pair<std::shared_ptr<matcher>, int> >::iterator it=matchers.begin();it!=matchers.end();++it) {
if (it->first->matches(item)) {
return it->second;
}
diff -Naur newsbeuter-2.8/src/rss.cpp newsbeuter-2.8-m/src/rss.cpp
--- newsbeuter-2.8/src/rss.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/rss.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -120,7 +120,7 @@
unsigned int rss_feed::unread_item_count() {
scope_mutex lock(&item_mutex);
unsigned int count = 0;
- for (std::vector<std::tr1::shared_ptr<rss_item> >::const_iterator it=items_.begin();it!=items_.end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::const_iterator it=items_.begin();it!=items_.end();++it) {
if ((*it)->unread())
++count;
}
@@ -209,16 +209,16 @@
return false;
}
-std::tr1::shared_ptr<rss_item> rss_feed::get_item_by_guid(const std::string& guid) {
+std::shared_ptr<rss_item> rss_feed::get_item_by_guid(const std::string& guid) {
scope_mutex lock(&item_mutex);
return get_item_by_guid_unlocked(guid);
}
-std::tr1::shared_ptr<rss_item> rss_feed::get_item_by_guid_unlocked(const std::string& guid) {
+std::shared_ptr<rss_item> rss_feed::get_item_by_guid_unlocked(const std::string& guid) {
LOG(LOG_DEBUG, "get_item_by_guid_unlocked: guid = %s", guid.c_str());
{
scope_mutex lock(&items_guid_map_mutex);
- std::tr1::unordered_map<std::string, std::tr1::shared_ptr<rss_item> >::const_iterator it;
+ std::unordered_map<std::string, std::shared_ptr<rss_item> >::const_iterator it;
if ((it = items_guid_map.find(guid)) != items_guid_map.end()) {
return it->second;
}
@@ -226,7 +226,7 @@
LOG(LOG_DEBUG, "rss_feed::get_item_by_guid_unlocked: items_guid_map.size = %d", items_guid_map.size());
}
abort();
- return std::tr1::shared_ptr<rss_item>(new rss_item(ch)); // should never happen!
+ return std::shared_ptr<rss_item>(new rss_item(ch)); // should never happen!
}
bool rss_item::has_attribute(const std::string& attribname) {
@@ -430,7 +430,7 @@
return false;
}
-void rss_feed::update_items(std::vector<std::tr1::shared_ptr<rss_feed> > feeds) {
+void rss_feed::update_items(std::vector<std::shared_ptr<rss_feed> > feeds) {
scope_mutex lock(&item_mutex);
if (query.length() == 0)
return;
@@ -448,9 +448,9 @@
scope_mutex lock(&items_guid_map_mutex);
items_guid_map.clear();
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
if ((*it)->rssurl().substr(0,6) != "query:") { // don't fetch items from other query feeds!
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator jt=(*it)->items().begin();jt!=(*it)->items().end();++jt) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator jt=(*it)->items().begin();jt!=(*it)->items().end();++jt) {
if (m.matches(jt->get())) {
LOG(LOG_DEBUG, "rss_feed::update_items: matcher matches!");
(*jt)->set_feedptr(*it);
@@ -486,50 +486,50 @@
}
}
-struct sort_item_by_title : public std::binary_function<std::tr1::shared_ptr<rss_item>, std::tr1::shared_ptr<rss_item>, bool> {
+struct sort_item_by_title : public std::binary_function<std::shared_ptr<rss_item>, std::shared_ptr<rss_item>, bool> {
bool reverse;
sort_item_by_title(bool b) : reverse(b) { }
- bool operator()(std::tr1::shared_ptr<rss_item> a, std::tr1::shared_ptr<rss_item> b) {
+ bool operator()(std::shared_ptr<rss_item> a, std::shared_ptr<rss_item> b) {
return reverse ? (strcasecmp(a->title().c_str(), b->title().c_str()) > 0) : (strcasecmp(a->title().c_str(), b->title().c_str()) < 0);
}
};
-struct sort_item_by_flags : public std::binary_function<std::tr1::shared_ptr<rss_item>, std::tr1::shared_ptr<rss_item>, bool> {
+struct sort_item_by_flags : public std::binary_function<std::shared_ptr<rss_item>, std::shared_ptr<rss_item>, bool> {
bool reverse;
sort_item_by_flags(bool b) : reverse(b) { }
- bool operator()(std::tr1::shared_ptr<rss_item> a, std::tr1::shared_ptr<rss_item> b) {
+ bool operator()(std::shared_ptr<rss_item> a, std::shared_ptr<rss_item> b) {
return reverse ? (strcmp(a->flags().c_str(), b->flags().c_str()) > 0) : (strcmp(a->flags().c_str(), b->flags().c_str()) < 0);
}
};
-struct sort_item_by_author : public std::binary_function<std::tr1::shared_ptr<rss_item>, std::tr1::shared_ptr<rss_item>, bool> {
+struct sort_item_by_author : public std::binary_function<std::shared_ptr<rss_item>, std::shared_ptr<rss_item>, bool> {
bool reverse;
sort_item_by_author(bool b) : reverse(b) { }
- bool operator()(std::tr1::shared_ptr<rss_item> a, std::tr1::shared_ptr<rss_item> b) {
+ bool operator()(std::shared_ptr<rss_item> a, std::shared_ptr<rss_item> b) {
return reverse ? (strcmp(a->author().c_str(), b->author().c_str()) > 0) : (strcmp(a->author().c_str(), b->author().c_str()) < 0);
}
};
-struct sort_item_by_link : public std::binary_function<std::tr1::shared_ptr<rss_item>, std::tr1::shared_ptr<rss_item>, bool> {
+struct sort_item_by_link : public std::binary_function<std::shared_ptr<rss_item>, std::shared_ptr<rss_item>, bool> {
bool reverse;
sort_item_by_link(bool b) : reverse(b) { }
- bool operator()(std::tr1::shared_ptr<rss_item> a, std::tr1::shared_ptr<rss_item> b) {
+ bool operator()(std::shared_ptr<rss_item> a, std::shared_ptr<rss_item> b) {
return reverse ? (strcmp(a->link().c_str(), b->link().c_str()) > 0) : (strcmp(a->link().c_str(), b->link().c_str()) < 0);
}
};
-struct sort_item_by_guid : public std::binary_function<std::tr1::shared_ptr<rss_item>, std::tr1::shared_ptr<rss_item>, bool> {
+struct sort_item_by_guid : public std::binary_function<std::shared_ptr<rss_item>, std::shared_ptr<rss_item>, bool> {
bool reverse;
sort_item_by_guid(bool b) : reverse(b) { }
- bool operator()(std::tr1::shared_ptr<rss_item> a, std::tr1::shared_ptr<rss_item> b) {
+ bool operator()(std::shared_ptr<rss_item> a, std::shared_ptr<rss_item> b) {
return reverse ? (strcmp(a->guid().c_str(), b->guid().c_str()) > 0) : (strcmp(a->guid().c_str(), b->guid().c_str()) < 0);
}
};
-struct sort_item_by_date : public std::binary_function<std::tr1::shared_ptr<rss_item>, std::tr1::shared_ptr<rss_item>, bool> {
+struct sort_item_by_date : public std::binary_function<std::shared_ptr<rss_item>, std::shared_ptr<rss_item>, bool> {
bool reverse;
sort_item_by_date(bool b) : reverse(b) { }
- bool operator()(std::tr1::shared_ptr<rss_item> a, std::tr1::shared_ptr<rss_item> b) {
+ bool operator()(std::shared_ptr<rss_item> a, std::shared_ptr<rss_item> b) {
return reverse ? (a->pubDate_timestamp() > b->pubDate_timestamp()) : (a->pubDate_timestamp() < b->pubDate_timestamp());
}
};
@@ -573,7 +573,7 @@
void rss_feed::remove_old_deleted_items() {
scope_mutex lock(&item_mutex);
std::vector<std::string> guids;
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=items_.begin();it!=items_.end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=items_.begin();it!=items_.end();++it) {
guids.push_back((*it)->guid());
}
ch->remove_old_deleted_items(rssurl_, guids);
@@ -582,7 +582,7 @@
void rss_feed::purge_deleted_items() {
scope_mutex lock(&item_mutex);
scope_measure m1("rss_feed::purge_deleted_items");
- std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=items_.begin();
+ std::vector<std::shared_ptr<rss_item> >::iterator it=items_.begin();
while (it!=items_.end()) {
if ((*it)->deleted()) {
{
@@ -597,14 +597,14 @@
}
}
-void rss_feed::set_feedptrs(std::tr1::shared_ptr<rss_feed> self) {
+void rss_feed::set_feedptrs(std::shared_ptr<rss_feed> self) {
scope_mutex lock(&item_mutex);
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=items_.begin();it!=items_.end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=items_.begin();it!=items_.end();++it) {
(*it)->set_feedptr(self);
}
}
-void rss_item::set_feedptr(std::tr1::shared_ptr<rss_feed> ptr) {
+void rss_item::set_feedptr(std::shared_ptr<rss_feed> ptr) {
feedptr = ptr;
}
@@ -620,7 +620,7 @@
void rss_feed::unload() {
scope_mutex lock(&item_mutex);
- for (std::vector<std::tr1::shared_ptr<rss_item> >::iterator it=items_.begin();it!=items_.end();++it) {
+ for (std::vector<std::shared_ptr<rss_item> >::iterator it=items_.begin();it!=items_.end();++it) {
(*it)->unload();
}
}
diff -Naur newsbeuter-2.8/src/rss_parser.cpp newsbeuter-2.8-m/src/rss_parser.cpp
--- newsbeuter-2.8/src/rss_parser.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/rss_parser.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -28,8 +28,8 @@
rss_parser::~rss_parser() { }
-std::tr1::shared_ptr<rss_feed> rss_parser::parse() {
- std::tr1::shared_ptr<rss_feed> feed(new rss_feed(ch));
+std::shared_ptr<rss_feed> rss_parser::parse() {
+ std::shared_ptr<rss_feed> feed(new rss_feed(ch));
feed->set_rssurl(my_uri);
@@ -86,7 +86,7 @@
return "";
}
-void rss_parser::set_rtl(std::tr1::shared_ptr<rss_feed> feed, const char * lang) {
+void rss_parser::set_rtl(std::shared_ptr<rss_feed> feed, const char * lang) {
// we implement right-to-left support for the languages listed in
// http://blogs.msdn.com/rssteam/archive/2007/05/17/reading-feeds-in-right-to-left-order.aspx
static const char * rtl_langprefix[] = {
@@ -223,7 +223,7 @@
LOG(LOG_DEBUG, "rss_parser::parse: filterplugin %s, is_valid = %s", filter.c_str(), is_valid ? "true" : "false");
}
-void rss_parser::fill_feed_fields(std::tr1::shared_ptr<rss_feed> feed) {
+void rss_parser::fill_feed_fields(std::shared_ptr<rss_feed> feed) {
/*
* we fill all the feed members with the appropriate values from the rsspp data structure
*/
@@ -247,13 +247,13 @@
LOG(LOG_DEBUG, "rss_parser::parse: feed title = `%s' link = `%s'", feed->title().c_str(), feed->link().c_str());
}
-void rss_parser::fill_feed_items(std::tr1::shared_ptr<rss_feed> feed) {
+void rss_parser::fill_feed_items(std::shared_ptr<rss_feed> feed) {
/*
* we iterate over all items of a feed, create an rss_item object for
* each item, and fill it with the appropriate values from the data structure.
*/
for (std::vector<rsspp::item>::iterator item=f.items.begin();item!=f.items.end();++item) {
- std::tr1::shared_ptr<rss_item> x(new rss_item(ch));
+ std::shared_ptr<rss_item> x(new rss_item(ch));
set_item_title(feed, x, *item);
@@ -324,7 +324,7 @@
}
}
-void rss_parser::set_item_title(std::tr1::shared_ptr<rss_feed> feed, std::tr1::shared_ptr<rss_item> x, rsspp::item& item) {
+void rss_parser::set_item_title(std::shared_ptr<rss_feed> feed, std::shared_ptr<rss_item> x, rsspp::item& item) {
if (is_html_type(item.title_type)) {
x->set_title(render_xhtml_title(item.title, feed->link()));
} else {
@@ -334,7 +334,7 @@
}
}
-void rss_parser::set_item_author(std::tr1::shared_ptr<rss_item> x, rsspp::item& item) {
+void rss_parser::set_item_author(std::shared_ptr<rss_item> x, rsspp::item& item) {
/*
* some feeds only have a feed-wide managingEditor, which we use as an item's
* author if there is no item-specific one available.
@@ -350,7 +350,7 @@
}
}
-void rss_parser::set_item_content(std::tr1::shared_ptr<rss_item> x, rsspp::item& item) {
+void rss_parser::set_item_content(std::shared_ptr<rss_item> x, rsspp::item& item) {
handle_content_encoded(x, item);
@@ -392,14 +392,14 @@
return ""; // too bad.
}
-void rss_parser::set_item_enclosure(std::tr1::shared_ptr<rss_item> x, rsspp::item& item) {
+void rss_parser::set_item_enclosure(std::shared_ptr<rss_item> x, rsspp::item& item) {
x->set_enclosure_url(item.enclosure_url);
x->set_enclosure_type(item.enclosure_type);
LOG(LOG_DEBUG, "rss_parser::parse: found enclosure_url: %s", item.enclosure_url.c_str());
LOG(LOG_DEBUG, "rss_parser::parse: found enclosure_type: %s", item.enclosure_type.c_str());
}
-void rss_parser::add_item_to_feed(std::tr1::shared_ptr<rss_feed> feed, std::tr1::shared_ptr<rss_item> item) {
+void rss_parser::add_item_to_feed(std::shared_ptr<rss_feed> feed, std::shared_ptr<rss_item> item) {
// only add item to feed if it isn't on the ignore list or if there is no ignore list
if (!ign || !ign->matches(item.get())) {
feed->add_item(item);
@@ -409,7 +409,7 @@
}
}
-void rss_parser::handle_content_encoded(std::tr1::shared_ptr<rss_item> x, rsspp::item& item) {
+void rss_parser::handle_content_encoded(std::shared_ptr<rss_item> x, rsspp::item& item) {
if (x->description() != "")
return;
@@ -421,7 +421,7 @@
}
}
-void rss_parser::handle_itunes_summary(std::tr1::shared_ptr<rss_item> x, rsspp::item& item) {
+void rss_parser::handle_itunes_summary(std::shared_ptr<rss_item> x, rsspp::item& item) {
if (x->description() != "")
return;
diff -Naur newsbeuter-2.8/src/view.cpp newsbeuter-2.8-m/src/view.cpp
--- newsbeuter-2.8/src/view.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/src/view.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -74,14 +74,14 @@
void view::update_bindings() {
- for (std::vector<std::tr1::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
+ for (std::vector<std::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
if (*it) {
set_bindings(*it);
}
}
}
-void view::set_bindings(std::tr1::shared_ptr<formaction> fa) {
+void view::set_bindings(std::shared_ptr<formaction> fa) {
std::string upkey("** "); upkey.append(keys->getkey(OP_SK_UP, fa->id()));
std::string downkey("** "); downkey.append(keys->getkey(OP_SK_DOWN, fa->id()));
fa->get_form()->set("bind_up", upkey);
@@ -109,16 +109,16 @@
fa->get_form()->set("bind_end", endkey);
}
-std::tr1::shared_ptr<formaction> view::get_current_formaction() {
+std::shared_ptr<formaction> view::get_current_formaction() {
if (formaction_stack.size() > 0 && current_formaction < formaction_stack.size()) {
return formaction_stack[current_formaction];
}
- return std::tr1::shared_ptr<formaction>();
+ return std::shared_ptr<formaction>();
}
void view::set_status_unlocked(const std::string& msg) {
if (formaction_stack.size() > 0 && get_current_formaction() != NULL) {
- std::tr1::shared_ptr<stfl::form> form = get_current_formaction()->get_form();
+ std::shared_ptr<stfl::form> form = get_current_formaction()->get_form();
if (form != NULL) {
form->set("msg",msg);
form->run(-1);
@@ -142,7 +142,7 @@
std::vector<macrocmd> macrocmds;
// create feedlist
- std::tr1::shared_ptr<feedlist_formaction> feedlist(new feedlist_formaction(this, feedlist_str));
+ std::shared_ptr<feedlist_formaction> feedlist(new feedlist_formaction(this, feedlist_str));
set_bindings(feedlist);
feedlist->set_regexmanager(rxman);
feedlist->set_tags(tags);
@@ -160,7 +160,7 @@
while (formaction_stack.size() > 0) {
// first, we take the current formaction.
- std::tr1::shared_ptr<formaction> fa = get_current_formaction();
+ std::shared_ptr<formaction> fa = get_current_formaction();
// we signal "oh, you will receive an operation soon"
fa->prepare();
@@ -190,7 +190,7 @@
if (!event || strcmp(event,"TIMEOUT")==0) {
if (fa->id() == "article")
- std::tr1::dynamic_pointer_cast<itemview_formaction, formaction>(fa)->update_percent();
+ std::dynamic_pointer_cast<itemview_formaction, formaction>(fa)->update_percent();
continue;
}
@@ -244,7 +244,7 @@
stfl::reset();
}
-std::string view::run_modal(std::tr1::shared_ptr<formaction> f, const std::string& value) {
+std::string view::run_modal(std::shared_ptr<formaction> f, const std::string& value) {
f->init();
unsigned int stacksize = formaction_stack.size();
@@ -252,7 +252,7 @@
current_formaction = formaction_stack_size() - 1;
while (formaction_stack.size() > stacksize) {
- std::tr1::shared_ptr<formaction> fa = get_current_formaction();
+ std::shared_ptr<formaction> fa = get_current_formaction();
fa->prepare();
@@ -297,12 +297,12 @@
}
void view::push_empty_formaction() {
- formaction_stack.push_back(std::tr1::shared_ptr<formaction>());
+ formaction_stack.push_back(std::shared_ptr<formaction>());
current_formaction = formaction_stack_size() - 1;
}
void view::open_in_pager(const std::string& filename) {
- formaction_stack.push_back(std::tr1::shared_ptr<formaction>());
+ formaction_stack.push_back(std::shared_ptr<formaction>());
current_formaction = formaction_stack_size() - 1;
std::string cmdline;
std::string pager = cfg->get_configvalue("pager");
@@ -328,7 +328,7 @@
}
void view::open_in_browser(const std::string& url) {
- formaction_stack.push_back(std::tr1::shared_ptr<formaction>());
+ formaction_stack.push_back(std::shared_ptr<formaction>());
current_formaction = formaction_stack_size() - 1;
std::string cmdline;
std::string browser = cfg->get_configvalue("browser");
@@ -355,11 +355,11 @@
pop_current_formaction();
}
-void view::update_visible_feeds(std::vector<std::tr1::shared_ptr<rss_feed> > feeds) {
+void view::update_visible_feeds(std::vector<std::shared_ptr<rss_feed> > feeds) {
try {
if (formaction_stack_size() > 0) {
scope_mutex lock(mtx);
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
feedlist->update_visible_feeds(feeds);
}
} catch (const matcherexception& e) {
@@ -368,18 +368,18 @@
}
}
-void view::set_feedlist(std::vector<std::tr1::shared_ptr<rss_feed> > feeds) {
+void view::set_feedlist(std::vector<std::shared_ptr<rss_feed> > feeds) {
try {
scope_mutex lock(mtx);
- for (std::vector<std::tr1::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
+ for (std::vector<std::shared_ptr<rss_feed> >::iterator it=feeds.begin();it!=feeds.end();++it) {
if ((*it)->rssurl().substr(0,6) != "query:") {
(*it)->set_feedptrs(*it);
}
}
if (formaction_stack_size() > 0) {
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
feedlist->set_feedlist(feeds);
}
} catch (const matcherexception& e) {
@@ -392,12 +392,12 @@
tags = t;
}
-void view::push_searchresult(std::tr1::shared_ptr<rss_feed> feed, const std::string& phrase) {
+void view::push_searchresult(std::shared_ptr<rss_feed> feed, const std::string& phrase) {
assert(feed != NULL);
LOG(LOG_DEBUG, "view::push_searchresult: pushing search result");
if (feed->items().size() > 0) {
- std::tr1::shared_ptr<itemlist_formaction> searchresult(new itemlist_formaction(this, itemlist_str));
+ std::shared_ptr<itemlist_formaction> searchresult(new itemlist_formaction(this, itemlist_str));
set_bindings(searchresult);
searchresult->set_regexmanager(rxman);
searchresult->set_feed(feed);
@@ -414,7 +414,7 @@
}
-void view::push_itemlist(std::tr1::shared_ptr<rss_feed> feed) {
+void view::push_itemlist(std::shared_ptr<rss_feed> feed) {
assert(feed != NULL);
feed->purge_deleted_items();
@@ -422,7 +422,7 @@
prepare_query_feed(feed);
if (feed->items().size() > 0) {
- std::tr1::shared_ptr<itemlist_formaction> itemlist(new itemlist_formaction(this, itemlist_str));
+ std::shared_ptr<itemlist_formaction> itemlist(new itemlist_formaction(this, itemlist_str));
set_bindings(itemlist);
itemlist->set_regexmanager(rxman);
itemlist->set_feed(feed);
@@ -438,21 +438,21 @@
}
void view::push_itemlist(unsigned int pos) {
- std::tr1::shared_ptr<rss_feed> feed = ctrl->get_feed(pos);
+ std::shared_ptr<rss_feed> feed = ctrl->get_feed(pos);
LOG(LOG_DEBUG, "view::push_itemlist: retrieved feed at position %d", pos);
push_itemlist(feed);
if (feed->items().size() > 0) {
- std::tr1::shared_ptr<itemlist_formaction> itemlist = std::tr1::dynamic_pointer_cast<itemlist_formaction, formaction>(get_current_formaction());
+ std::shared_ptr<itemlist_formaction> itemlist = std::dynamic_pointer_cast<itemlist_formaction, formaction>(get_current_formaction());
itemlist->set_pos(pos);
}
}
-void view::push_itemview(std::tr1::shared_ptr<rss_feed> f, const std::string& guid, const std::string& searchphrase) {
+void view::push_itemview(std::shared_ptr<rss_feed> f, const std::string& guid, const std::string& searchphrase) {
std::string pager;
if ((pager = cfg->get_configvalue("pager")) == "internal") {
- std::tr1::shared_ptr<itemlist_formaction> itemlist = std::tr1::dynamic_pointer_cast<itemlist_formaction, formaction>(get_current_formaction());
+ std::shared_ptr<itemlist_formaction> itemlist = std::dynamic_pointer_cast<itemlist_formaction, formaction>(get_current_formaction());
assert(itemlist != NULL);
- std::tr1::shared_ptr<itemview_formaction> itemview(new itemview_formaction(this, itemlist, itemview_str));
+ std::shared_ptr<itemview_formaction> itemview(new itemview_formaction(this, itemlist, itemview_str));
set_bindings(itemview);
itemview->set_regexmanager(rxman);
itemview->set_feed(f);
@@ -473,7 +473,7 @@
void view::view_dialogs() {
if (get_current_formaction() != NULL && get_current_formaction()->id() != "dialogs") {
- std::tr1::shared_ptr<dialogs_formaction> dialogs(new dialogs_formaction(this, dialogs_str));
+ std::shared_ptr<dialogs_formaction> dialogs(new dialogs_formaction(this, dialogs_str));
dialogs->set_parent_formaction(get_current_formaction());
apply_colors(dialogs);
dialogs->init();
@@ -483,7 +483,7 @@
}
void view::push_help() {
- std::tr1::shared_ptr<help_formaction> helpview(new help_formaction(this, help_str));
+ std::shared_ptr<help_formaction> helpview(new help_formaction(this, help_str));
set_bindings(helpview);
apply_colors(helpview);
helpview->set_context(get_current_formaction()->id());
@@ -494,7 +494,7 @@
}
void view::push_urlview(const std::vector<linkpair>& links) {
- std::tr1::shared_ptr<urlview_formaction> urlview(new urlview_formaction(this, urlview_str));
+ std::shared_ptr<urlview_formaction> urlview(new urlview_formaction(this, urlview_str));
set_bindings(urlview);
apply_colors(urlview);
urlview->set_parent_formaction(get_current_formaction());
@@ -505,7 +505,7 @@
}
std::string view::run_filebrowser(const std::string& default_filename, const std::string& dir) {
- std::tr1::shared_ptr<filebrowser_formaction> filebrowser(new filebrowser_formaction(this, filebrowser_str));
+ std::shared_ptr<filebrowser_formaction> filebrowser(new filebrowser_formaction(this, filebrowser_str));
set_bindings(filebrowser);
apply_colors(filebrowser);
filebrowser->set_dir(dir);
@@ -515,7 +515,7 @@
}
std::string view::select_tag(const std::vector<std::string>& tags) {
- std::tr1::shared_ptr<select_formaction> selecttag(new select_formaction(this, selecttag_str));
+ std::shared_ptr<select_formaction> selecttag(new select_formaction(this, selecttag_str));
set_bindings(selecttag);
apply_colors(selecttag);
selecttag->set_parent_formaction(get_current_formaction());
@@ -526,7 +526,7 @@
}
std::string view::select_filter(const std::vector<filter_name_expr_pair>& filters) {
- std::tr1::shared_ptr<select_formaction> selecttag(new select_formaction(this, selecttag_str));
+ std::shared_ptr<select_formaction> selecttag(new select_formaction(this, selecttag_str));
set_bindings(selecttag);
apply_colors(selecttag);
selecttag->set_parent_formaction(get_current_formaction());
@@ -539,8 +539,8 @@
char view::confirm(const std::string& prompt, const std::string& charset) {
LOG(LOG_DEBUG, "view::confirm: charset = %s", charset.c_str());
- std::tr1::shared_ptr<formaction> f = get_current_formaction();
- formaction_stack.push_back(std::tr1::shared_ptr<formaction>());
+ std::shared_ptr<formaction> f = get_current_formaction();
+ formaction_stack.push_back(std::shared_ptr<formaction>());
current_formaction = formaction_stack_size() - 1;
f->get_form()->set("msg", prompt);
@@ -567,12 +567,12 @@
return result;
}
-void view::notify_itemlist_change(std::tr1::shared_ptr<rss_feed> feed) {
- for (std::vector<std::tr1::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
+void view::notify_itemlist_change(std::shared_ptr<rss_feed> feed) {
+ for (std::vector<std::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
if (*it != NULL && (*it)->id() == "articlelist") {
- std::tr1::shared_ptr<itemlist_formaction> itemlist = std::tr1::dynamic_pointer_cast<itemlist_formaction, formaction>(*it);
+ std::shared_ptr<itemlist_formaction> itemlist = std::dynamic_pointer_cast<itemlist_formaction, formaction>(*it);
if (itemlist != NULL) {
- std::tr1::shared_ptr<rss_feed> f = itemlist->get_feed();
+ std::shared_ptr<rss_feed> f = itemlist->get_feed();
if (f != NULL && f->rssurl() == feed->rssurl()) {
itemlist->set_feed(feed);
itemlist->set_redraw(true);
@@ -584,7 +584,7 @@
bool view::get_random_unread(itemlist_formaction * itemlist, itemview_formaction * itemview) {
unsigned int feedpos;
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
if (!cfg->get_configvalue_as_bool("goto-next-feed")) {
return false;
}
@@ -609,7 +609,7 @@
bool view::get_previous_unread(itemlist_formaction * itemlist, itemview_formaction * itemview) {
unsigned int feedpos;
LOG(LOG_DEBUG, "view::get_previous_unread: trying to find previous unread");
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
if (itemlist->jump_to_previous_unread_item(false)) {
LOG(LOG_DEBUG, "view::get_previous_unread: found unread article in same feed");
if (itemview) {
@@ -640,7 +640,7 @@
}
bool view::get_next_unread_feed(itemlist_formaction * itemlist) {
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
unsigned int feedpos;
assert(feedlist != NULL);
if (feedlist->jump_to_next_unread_feed(feedpos)) {
@@ -654,7 +654,7 @@
}
bool view::get_prev_unread_feed(itemlist_formaction * itemlist) {
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
unsigned int feedpos;
assert(feedlist != NULL);
if (feedlist->jump_to_previous_unread_feed(feedpos)) {
@@ -669,7 +669,7 @@
bool view::get_next_unread(itemlist_formaction * itemlist, itemview_formaction * itemview) {
unsigned int feedpos;
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
LOG(LOG_DEBUG, "view::get_next_unread: trying to find next unread");
if (itemlist->jump_to_next_unread_item(false)) {
LOG(LOG_DEBUG, "view::get_next_unread: found unread article in same feed");
@@ -702,7 +702,7 @@
bool view::get_previous(itemlist_formaction * itemlist, itemview_formaction * itemview) {
unsigned int feedpos;
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
if (itemlist->jump_to_previous_item(false)) {
LOG(LOG_DEBUG, "view::get_previous: article in same feed");
if (itemview) {
@@ -734,7 +734,7 @@
bool view::get_next(itemlist_formaction * itemlist, itemview_formaction * itemview) {
unsigned int feedpos;
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
if (itemlist->jump_to_next_item(false)) {
LOG(LOG_DEBUG, "view::get_next: article in same feed");
if (itemview) {
@@ -765,7 +765,7 @@
}
bool view::get_next_feed(itemlist_formaction * itemlist) {
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
unsigned int feedpos;
assert(feedlist != NULL);
if (feedlist->jump_to_next_feed(feedpos)) {
@@ -779,7 +779,7 @@
}
bool view::get_prev_feed(itemlist_formaction * itemlist) {
- std::tr1::shared_ptr<feedlist_formaction> feedlist = std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
+ std::shared_ptr<feedlist_formaction> feedlist = std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0]);
unsigned int feedpos;
assert(feedlist != NULL);
if (feedlist->jump_to_previous_feed(feedpos)) {
@@ -792,7 +792,7 @@
return false;
}
-void view::prepare_query_feed(std::tr1::shared_ptr<rss_feed> feed) {
+void view::prepare_query_feed(std::shared_ptr<rss_feed> feed) {
if (feed->rssurl().substr(0,6) == "query:") {
LOG(LOG_DEBUG, "view::prepare_query_feed: %s", feed->rssurl().c_str());
@@ -805,7 +805,7 @@
}
void view::force_redraw() {
- std::tr1::shared_ptr<formaction> fa = get_current_formaction();
+ std::shared_ptr<formaction> fa = get_current_formaction();
if (fa != NULL) {
fa->set_redraw(true);
fa->prepare();
@@ -814,8 +814,8 @@
}
void view::pop_current_formaction() {
- std::tr1::shared_ptr<formaction> f = get_current_formaction();
- std::vector<std::tr1::shared_ptr<formaction> >::iterator it=formaction_stack.begin();
+ std::shared_ptr<formaction> f = get_current_formaction();
+ std::vector<std::shared_ptr<formaction> >::iterator it=formaction_stack.begin();
for (unsigned int i=0;i<current_formaction;i++)
++it;
formaction_stack.erase(it);
@@ -823,20 +823,20 @@
current_formaction = formaction_stack_size() - 1; // XXX TODO this is not correct... we'd need to return to the previous one, but NULL formactions have no parent
} else if (formaction_stack.size() > 0) {
// first, we set back the parent formactions of those who reference the formaction we just removed
- for (std::vector<std::tr1::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
+ for (std::vector<std::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
if ((*it)->get_parent_formaction() == f) {
(*it)->set_parent_formaction(formaction_stack[0]);
}
}
// we set the new formaction based on the removed formaction's parent.
unsigned int i=0;
- for (std::vector<std::tr1::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it,i++) {
+ for (std::vector<std::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it,i++) {
if (*it == f->get_parent_formaction()) {
current_formaction = i;
break;
}
}
- std::tr1::shared_ptr<formaction> f = get_current_formaction();
+ std::shared_ptr<formaction> f = get_current_formaction();
if (f) {
f->set_redraw(true);
f->get_form()->set("msg","");
@@ -851,15 +851,15 @@
}
void view::remove_formaction(unsigned int pos) {
- std::tr1::shared_ptr<formaction> f = formaction_stack[pos];
- std::vector<std::tr1::shared_ptr<formaction> >::iterator it=formaction_stack.begin();
+ std::shared_ptr<formaction> f = formaction_stack[pos];
+ std::vector<std::shared_ptr<formaction> >::iterator it=formaction_stack.begin();
for (unsigned int i=0;i<pos;i++)
++it;
formaction_stack.erase(it);
current_formaction--;
if (f != NULL && formaction_stack.size() > 0) {
// we set back the parent formactions of those who reference the formaction we just removed
- for (std::vector<std::tr1::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
+ for (std::vector<std::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
if ((*it)->get_parent_formaction() == f) {
(*it)->set_parent_formaction(formaction_stack[0]);
}
@@ -874,7 +874,7 @@
}
void view::apply_colors_to_all_formactions() {
- for (std::vector<std::tr1::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
+ for (std::vector<std::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it) {
apply_colors(*it);
}
if (formaction_stack.size() > 0 && formaction_stack[current_formaction]) {
@@ -882,7 +882,7 @@
}
}
-void view::apply_colors(std::tr1::shared_ptr<formaction> fa) {
+void view::apply_colors(std::shared_ptr<formaction> fa) {
std::map<std::string,std::string>::const_iterator fgcit = fg_colors.begin();
std::map<std::string,std::string>::const_iterator bgcit = bg_colors.begin();
std::map<std::string,std::vector<std::string> >::const_iterator attit = attributes.begin();
@@ -948,7 +948,7 @@
void view::feedlist_mark_pos_if_visible(unsigned int pos) {
if (formaction_stack_size() > 0) {
- std::tr1::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0])->mark_pos_if_visible(pos);
+ std::dynamic_pointer_cast<feedlist_formaction, formaction>(formaction_stack[0])->mark_pos_if_visible(pos);
}
}
@@ -960,7 +960,7 @@
std::vector<std::pair<unsigned int, std::string> > view::get_formaction_names() {
std::vector<std::pair<unsigned int, std::string> > formaction_names;
unsigned int i=0;
- for (std::vector<std::tr1::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it,i++) {
+ for (std::vector<std::shared_ptr<formaction> >::iterator it=formaction_stack.begin();it!=formaction_stack.end();++it,i++) {
if (*it && (*it)->id() != "dialogs") {
formaction_names.push_back(std::pair<unsigned int, std::string>(i, (*it)->title()));
}
@@ -990,13 +990,13 @@
is_inside_cmdline = f;
}
-void view::clear_line(std::tr1::shared_ptr<formaction> fa) {
+void view::clear_line(std::shared_ptr<formaction> fa) {
fa->get_form()->set("qna_value", "");
fa->get_form()->set("qna_value_pos", "0");
LOG(LOG_DEBUG, "view::clear_line: cleared line");
}
-void view::clear_eol(std::tr1::shared_ptr<formaction> fa) {
+void view::clear_eol(std::shared_ptr<formaction> fa) {
unsigned int pos = utils::to_u(fa->get_form()->get("qna_value_pos"));
std::string val = fa->get_form()->get("qna_value");
val.erase(pos, val.length());
@@ -1005,12 +1005,12 @@
LOG(LOG_DEBUG, "view::clear_eol: cleared to end of line");
}
-void view::cancel_input(std::tr1::shared_ptr<formaction> fa) {
+void view::cancel_input(std::shared_ptr<formaction> fa) {
fa->process_op(OP_INT_CANCEL_QNA);
LOG(LOG_DEBUG, "view::cancel_input: cancelled input");
}
-void view::delete_word(std::tr1::shared_ptr<formaction> fa) {
+void view::delete_word(std::shared_ptr<formaction> fa) {
std::string::size_type curpos = utils::to_u(fa->get_form()->get("qna_value_pos"));
std::string val = fa->get_form()->get("qna_value");
std::string::size_type firstpos = curpos;
@@ -1033,7 +1033,7 @@
fa->get_form()->set("qna_value_pos", utils::to_string<unsigned int>(firstpos));
}
-void view::handle_cmdline_completion(std::tr1::shared_ptr<formaction> fa) {
+void view::handle_cmdline_completion(std::shared_ptr<formaction> fa) {
std::string fragment = fa->get_form()->get("qna_value");
if (fragment != last_fragment || fragment == "") {
last_fragment = fragment;
diff -Naur newsbeuter-2.8/test/test.cpp newsbeuter-2.8-m/test/test.cpp
--- newsbeuter-2.8/test/test.cpp 2014-01-19 07:10:41.000000000 +0800
+++ newsbeuter-2.8-m/test/test.cpp 2014-02-02 12:41:26.000000000 +0800
@@ -38,7 +38,7 @@
cache * rsscache = new cache("test-cache.db", cfg);
rss_parser parser("http://testbed.newsbeuter.org/unit-test/rss.xml", rsscache, cfg, NULL);
- std::tr1::shared_ptr<rss_feed> feed = parser.parse();
+ std::shared_ptr<rss_feed> feed = parser.parse();
lemon.is(feed->items().size(), 8u, "rss.xml contains 8 items");
rsscache->externalize_rssfeed(feed, false);
@@ -54,7 +54,7 @@
rsscache->externalize_rssfeed(feed, false);
- std::tr1::shared_ptr<rss_feed> feed2(new rss_feed(rsscache));
+ std::shared_ptr<rss_feed> feed2(new rss_feed(rsscache));
feed2->set_rssurl("http://testbed.newsbeuter.org/unit-test/rss.xml");
rsscache->internalize_rssfeed(feed2, NULL);
@@ -66,7 +66,7 @@
lemon.is(feedurls.size(), 1u, "1 feed url");
lemon.is(feedurls[0], "http://testbed.newsbeuter.org/unit-test/rss.xml", "first feed url");
- std::vector<std::tr1::shared_ptr<rss_feed> > feedv;
+ std::vector<std::shared_ptr<rss_feed> > feedv;
feedv.push_back(feed);
cfg->set_configvalue("cleanup-on-quit", "true");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment