Skip to content

Commit 0621029

Browse files
committed
Fix regex to extract domain, improve install script
1 parent fe5ab4a commit 0621029

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/bash
2-
3-
git clone https://github.com/alex1701c/QuickWebShortcuts
4-
cd QuickWebShortcuts/
2+
if [[ $(basename "$PWD") != "QuickWebShortcuts" ]];then
3+
git clone https://github.com/alex1701c/QuickWebShortcuts
4+
cd QuickWebShortcuts/
5+
fi
56
mkdir build
67
cd build
78
cmake -DQT_PLUGIN_INSTALL_DIR=`kf5-config --qt-plugins` ..

src/config/quick_web_shortcuts_config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void QuickWebShortcutsConfig::load() {
9090

9191
void QuickWebShortcutsConfig::extractNameFromURL() {
9292
if (m_ui->searchEngineURL->text().contains(QRegExp(R"(^(?:https?://)?(?:[\w]+\.)(?:\.?[\w]{2,})+)"))) {
93-
QRegExp exp(R"(^(?:https?://)?([\w]+)\.(?:\.?[\w]{2,})+)");
93+
QRegExp exp(R"(^(?:https?://)(www\.)?([^/]+)\.(?:\.?[\w]{2,})+/?)");
9494
exp.indexIn(m_ui->searchEngineURL->text());
9595
QString res = exp.capturedTexts().last();
9696
res[0] = res[0].toUpper();

src/quick_web_shortcuts.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@
1414
You should have received a copy of the GNU Lesser General Public
1515
License along with this library. If not, see <http://www.gnu.org/licenses/>.
1616
*/
17-
18-
/*
19-
* DONE Delete functionality for manually added search engines
20-
* DONE Handle defaults inside GUI
21-
* DONE Extract Search Engine config to file
22-
* DONE Read custom search engines for Krunner settings(inside runner)
23-
* DONE Extract Name from URL ?
24-
* DONE Handle event for add search engine in GUI
25-
* DONE Make Items in ComboBox editable
26-
* DONE Handle save in GUI
27-
* DONE Handle Defaults in GUI
28-
* DONE: Mark current in Gui
29-
*/
3017
#include "quick_web_shortcuts.h"
3118
#include <KLocalizedString>
3219
#include <QtGui/QtGui>

0 commit comments

Comments
 (0)