Permalink
Browse files

client=globalparameters.application_name() in void ToolbarSearch::sea…

…rch_now()
  • Loading branch information...
1 parent b60fb36 commit 9ac0d329653b3b3c10631d64171a31a27a53b46f @beimprovised committed Dec 10, 2016
@@ -459,7 +459,7 @@ win32 {
mac {
ICON = browser.icns
QMAKE_INFO_PLIST = Info_mac.plist
- TARGET = mytetra
+ TARGET = mytetra_engine
}
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
@@ -103,21 +103,21 @@ namespace browser {
_findtext->setVisible(false);
QMenu *m = menu();
- connect(m, &QMenu::aboutToShow, this, &ToolbarSearch::aboutToShowMenu);
- connect(m, &QMenu::triggered, this, &ToolbarSearch::triggeredMenuAction);
+ connect(m, &QMenu::aboutToShow, this, &ToolbarSearch::show_menu);
+ connect(m, &QMenu::triggered, this, &ToolbarSearch::triggered_menu_action);
QCompleter *completer = new QCompleter(_stringlistmodel, this);
completer->setCompletionMode(QCompleter::InlineCompletion);
lineEdit()->setCompleter(completer);
assert(lineEdit());
- connect(lineEdit(), &QLineEdit::returnPressed, this, &ToolbarSearch::searchNow);// , [&] {std::thread(&ToolbarSearch::searchNow, this).detach();}); //
+ connect(lineEdit(), &QLineEdit::returnPressed, this, &ToolbarSearch::search_now);// , [&] {std::thread(&ToolbarSearch::searchNow, this).detach();}); //
connect(this, &SearchLineEdit::textChanged, _findtext, [&](const QString &text){
_findtext->setText(text);
});
// connect(this, &ToolbarSearch::returnPressed, _tabmanager, &TabManager::lineEditReturnPressed);
- connect(this, &ToolbarSearch::returnPressed, _findtext, &QLineEdit::returnPressed);
+ connect(this, &ToolbarSearch::return_pressed, _findtext, &QLineEdit::returnPressed);
setInactiveText(tr("Google"));
@@ -145,7 +145,7 @@ namespace browser {
settings.endGroup();
}
- void ToolbarSearch::searchNow(){
+ void ToolbarSearch::search_now(){
QString search_text = lineEdit()->text();
auto result_item = globalparameters.find_screen()->find_clicked();
@@ -224,7 +224,9 @@ namespace browser {
// url_query.addQueryItem(QLatin1String("q"), searchText);
url_query.addQueryItem(QLatin1String("ie"), QLatin1String("UTF-8"));
url_query.addQueryItem(QLatin1String("oe"), QLatin1String("UTF-8"));
- url_query.addQueryItem(QLatin1String("client"), QLatin1String(globalparameters.main_program_file().toLatin1()));
+ url_query.addQueryItem(QLatin1String("client"), QLatin1String(
+ globalparameters.application_name().toLatin1() // globalparameters.main_program_file().toLatin1()
+ ));
// urlQuery.addQueryItem();
search_engine.setQuery(url_query);
@@ -304,7 +306,7 @@ namespace browser {
}
}
- void ToolbarSearch::aboutToShowMenu(){
+ void ToolbarSearch::show_menu(){
lineEdit()->selectAll();
QMenu *m = menu();
m->clear();
@@ -324,12 +326,12 @@ namespace browser {
m->addAction(tr("Clear Recent Searches"), this, &ToolbarSearch::clear);
}
- void ToolbarSearch::triggeredMenuAction(QAction *action){
+ void ToolbarSearch::triggered_menu_action(QAction *action){
QVariant v = action->data();
if(v.canConvert<QString>()){
QString text = v.toString();
lineEdit()->setText(text);
- searchNow();// std::thread(&ToolbarSearch::searchNow, this).detach();
+ search_now();// std::thread(&ToolbarSearch::searchNow, this).detach();
}
}
@@ -362,7 +364,7 @@ namespace browser {
auto result = browser->bind(record_index);
result->activate(std::bind(&HidableTabWidget::find, _vtab_record, std::placeholders::_1));
_child_items.pop_back();
- emit resultReady();
+ emit result_ready();
}
}
@@ -109,7 +109,7 @@ namespace browser {
// emit resultReady();
// }
signals:
- void resultReady();
+ void result_ready();
private:
QList<boost::intrusive_ptr<TreeItem> > &_child_items;
public:
@@ -130,9 +130,9 @@ namespace browser {
// , equal_url_t _equal = [](boost::intrusive_ptr<const TreeItem> it, const QUrl &_url) ->bool {return it ? QUrl(it->field("url")).fragment() == _url.fragment() : false;}
// );
- void returnPressed()
+ void return_pressed()
#if QT_VERSION == 0x050600
- W_SIGNAL(returnPressed) //
+ W_SIGNAL(return_pressed) //
#else
;
#endif
@@ -153,12 +153,12 @@ namespace browser {
public slots:
void clear();
- void searchNow();
+ void search_now();
private slots:
void save();
- void aboutToShowMenu();
- void triggeredMenuAction(QAction *action);
+ void show_menu();
+ void triggered_menu_action(QAction *action);
private:
void load();
@@ -394,7 +394,7 @@ void FindScreen::setup_signals(void){
// При нажатии Enter в строке запроса
- connect(_toolbarsearch, &browser::ToolbarSearch::returnPressed, this, [this] {FindScreen::find_clicked();});
+ connect(_toolbarsearch, &browser::ToolbarSearch::return_pressed, this, [this] {FindScreen::find_clicked();});
// При нажатии кнопки Find
connect(_find_start_button, &QPushButton::clicked, this, [this] {FindScreen::find_clicked();});

0 comments on commit 9ac0d32

Please sign in to comment.