|
a/src/qtgui/advshist.cpp |
|
b/src/qtgui/advshist.cpp |
|
... |
|
... |
31 |
m_current = -1;
|
31 |
m_current = -1;
|
32 |
}
|
32 |
}
|
33 |
|
33 |
|
34 |
AdvSearchHist::~AdvSearchHist()
|
34 |
AdvSearchHist::~AdvSearchHist()
|
35 |
{
|
35 |
{
|
36 |
for (vector<RefCntr<SearchData> >::iterator it = m_entries.begin();
|
36 |
for (vector<STD_SHARED_PTR<SearchData> >::iterator it = m_entries.begin();
|
37 |
it != m_entries.end(); it++) {
|
37 |
it != m_entries.end(); it++) {
|
38 |
it->release();
|
38 |
it->reset();
|
39 |
}
|
39 |
}
|
40 |
}
|
40 |
}
|
41 |
|
41 |
|
42 |
RefCntr<Rcl::SearchData> AdvSearchHist::getnewest()
|
42 |
STD_SHARED_PTR<Rcl::SearchData> AdvSearchHist::getnewest()
|
43 |
{
|
43 |
{
|
44 |
if (m_entries.empty())
|
44 |
if (m_entries.empty())
|
45 |
return RefCntr<Rcl::SearchData>();
|
45 |
return STD_SHARED_PTR<Rcl::SearchData>();
|
46 |
|
46 |
|
47 |
return m_entries[0];
|
47 |
return m_entries[0];
|
48 |
}
|
48 |
}
|
49 |
|
49 |
|
50 |
RefCntr<Rcl::SearchData> AdvSearchHist::getolder()
|
50 |
STD_SHARED_PTR<Rcl::SearchData> AdvSearchHist::getolder()
|
51 |
{
|
51 |
{
|
52 |
m_current++;
|
52 |
m_current++;
|
53 |
if (m_current >= int(m_entries.size())) {
|
53 |
if (m_current >= int(m_entries.size())) {
|
54 |
m_current--;
|
54 |
m_current--;
|
55 |
return RefCntr<Rcl::SearchData>();
|
55 |
return STD_SHARED_PTR<Rcl::SearchData>();
|
56 |
}
|
56 |
}
|
57 |
return m_entries[m_current];
|
57 |
return m_entries[m_current];
|
58 |
}
|
58 |
}
|
59 |
|
59 |
|
60 |
RefCntr<Rcl::SearchData> AdvSearchHist::getnewer()
|
60 |
STD_SHARED_PTR<Rcl::SearchData> AdvSearchHist::getnewer()
|
61 |
{
|
61 |
{
|
62 |
if (m_current == -1 || m_current == 0 || m_entries.empty())
|
62 |
if (m_current == -1 || m_current == 0 || m_entries.empty())
|
63 |
return RefCntr<Rcl::SearchData>();
|
63 |
return STD_SHARED_PTR<Rcl::SearchData>();
|
64 |
return m_entries[--m_current];
|
64 |
return m_entries[--m_current];
|
65 |
}
|
65 |
}
|
66 |
|
66 |
|
67 |
bool AdvSearchHist::push(RefCntr<SearchData> sd)
|
67 |
bool AdvSearchHist::push(STD_SHARED_PTR<SearchData> sd)
|
68 |
{
|
68 |
{
|
69 |
m_entries.insert(m_entries.begin(), sd);
|
69 |
m_entries.insert(m_entries.begin(), sd);
|
70 |
if (m_current != -1)
|
70 |
if (m_current != -1)
|
71 |
m_current++;
|
71 |
m_current++;
|
72 |
|
72 |
|
|
... |
|
... |
81 |
return false;
|
81 |
return false;
|
82 |
list<string> lxml = g_dynconf->getStringList(advSearchHistSk);
|
82 |
list<string> lxml = g_dynconf->getStringList(advSearchHistSk);
|
83 |
|
83 |
|
84 |
for (list<string>::const_iterator it = lxml.begin(); it != lxml.end();
|
84 |
for (list<string>::const_iterator it = lxml.begin(); it != lxml.end();
|
85 |
it++) {
|
85 |
it++) {
|
86 |
RefCntr<SearchData> sd = xmlToSearchData(*it);
|
86 |
STD_SHARED_PTR<SearchData> sd = xmlToSearchData(*it);
|
87 |
if (sd)
|
87 |
if (sd)
|
88 |
m_entries.push_back(sd);
|
88 |
m_entries.push_back(sd);
|
89 |
}
|
89 |
}
|
90 |
return true;
|
90 |
return true;
|
91 |
}
|
91 |
}
|