mirror of https://github.com/f1xpl/openauto.git
Replace last recent address with newer one
parent
9c52942122
commit
50c2a437fa
|
@ -46,11 +46,18 @@ void RecentAddressesList::read()
|
||||||
|
|
||||||
void RecentAddressesList::insertAddress(const std::string& address)
|
void RecentAddressesList::insertAddress(const std::string& address)
|
||||||
{
|
{
|
||||||
if(std::find(list_.begin(), list_.end(), address) == list_.end())
|
if(std::find(list_.begin(), list_.end(), address) != list_.end())
|
||||||
{
|
{
|
||||||
list_.push_front(address);
|
return;
|
||||||
this->save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(list_.size() >= maxListSize_)
|
||||||
|
{
|
||||||
|
list_.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
|
list_.push_front(address);
|
||||||
|
this->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
RecentAddressesList::RecentAddresses RecentAddressesList::getList() const
|
RecentAddressesList::RecentAddresses RecentAddressesList::getList() const
|
||||||
|
|
|
@ -91,7 +91,7 @@ int main(int argc, char* argv[])
|
||||||
autoapp::ui::SettingsWindow settingsWindow(configuration);
|
autoapp::ui::SettingsWindow settingsWindow(configuration);
|
||||||
settingsWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
|
settingsWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
|
||||||
|
|
||||||
autoapp::configuration::RecentAddressesList recentAddressesList(5);
|
autoapp::configuration::RecentAddressesList recentAddressesList(7);
|
||||||
recentAddressesList.read();
|
recentAddressesList.read();
|
||||||
|
|
||||||
aasdk::tcp::TCPWrapper tcpWrapper;
|
aasdk::tcp::TCPWrapper tcpWrapper;
|
||||||
|
|
Loading…
Reference in New Issue