-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cli args #40
base: master
Are you sure you want to change the base?
Cli args #40
Conversation
search for -q, --query, or --address in the command line arguments, the next string is either an url or a street address in case of -q or --query, use url parser for extracting address="string" from the url paste the address to placeHeader.text and start searching
search for -q, --query, or --address in the command line arguments, the next string is either an url or a street address in case of -q or --query, use url parser for extracting address="string" from the url paste the address to placeHeader.text and start searching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for you're contribution. That's a nice addition. Tell me if you disagree with the minor changes I'm requesting.
src/main.qml
Outdated
|
||
function startSearch(address) { | ||
if (address > "") { | ||
header.searching = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have done this a bit differently, if you don't mind:
in PlaceHeader.qml
, add a function:
function search(text) {
searching = true
resultList.model = undefined
searchRequest(text)
}
and modify the EnterKey.onClicked
handler in the PageHeader to call this function.
Then in Header.qml
, add a forwarding function:
function search(text) {
placeHeader.search(text)
}
and call it in the new startSearch()
method of main you're introducing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified this a bit to write the address to the search field also.
function search(text, changeText) {
if (changeText)
search.text = text // address from command line
src/main.qml
Outdated
} | ||
|
||
function schemeComponents(url, decode, sepStr) { | ||
// modified from www.sitepoint.com/get-url-parameters-with-javascript/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find any copyright notice from their article, but since you're citing the source, let's say it's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if there is a proper way to do it...
parameters into readParameters(), and rewrite regular expressions detecting parameter arrays.
read address from command line arguments
search for -q, --query, or --address in the command line arguments, the
next string is either an url or a street address
in case of -q or --query, use url parser for extracting address="string" from the url
paste the address to placeHeader.text and start searching
url parser modified from getAllUrlParams on www.sitepoint.com/get-url-parameters-with-javascript/