I haven't written a scope yet but I have implemented what you described in bullet point 1 in my app. Here is my RequestManager <http://bazaar.launchpad.net/~nogzatalz/downow/trunk/view/head:/src/downow/search/RequestManager.cpp> class which delays requests as you described. It is pretty simple and generic. Regarding number 4 I'd suggest QtConcurrent <http://qt-project.org/doc/qt-5/qtconcurrent-index.html> for general background processing and QNetworkAccessManager <http://qt-project.org/doc/qt-5/qnetworkaccessmanager.html> for asynchronous HTTP requests if you're using Qt. If you're not using Qt I'd suggest Boost.Asio <http://www.boost.org/doc/libs/1_56_0/doc/html/boost_asio.html> which provides you with a run loop, asynchronous IO, and TCP sockets and also Boost.Thread <http://www.boost.org/doc/libs/1_56_0/doc/html/thread.html>.
On Mon, Nov 3, 2014 at 9:55 PM, Robert Schroll <rschr...@gmail.com> wrote: > Hi all, > > I started playing around with scopes and have run into a few questions. If > there's a better place to ask about this, please let me know. Otherwise: > > 1) Is it possible to delay a query until the user hits "Enter"? Or > failing that, until a second or so has passed from the last key stroke? I'm > experimenting with a service that rate-limits queries, and the partial > queries won't lead to useful results anyway. I'd prefer an explicit > indication from the user that they're done, but I'm not sure if that's > possible. I'm guessing that the delay is possible, but I don't know if > that should go in the client or the query or somewhere else. > > 2) Is it possible to display images without any rescaling or cropping? I > can tell the service the maximum size for images, but the actual size and > aspect ratio will depend on the content. Both in the query and the > preview, I'd like to insert those images as-is, but the defaults rescale > and, in the query view, crop them. > > In a related issue, I've set ShapeImages=false in the .ini file, but that > doesn't seem to have any effect. That could be related to... > > 3) How do you get an updated .ini file to be used? I'm testing on an > emulator (r243), and it seems to be caching the old .ini files. The only > way I can get it to recognize an updated one is to restart the emulator. > Surely there's a better way? > > 4) Is there some guide to making asynchronous queries? The tutorials I'm > working off of seem to be synchronous, although the docs suggest the > different parts may be running in different threads. But I'd like to fire > off a query, get and display some results, and then fire off some more > queries based on those results and display them when those replies get > back. I've never worked with asynchronous code in C++, so a pointer to a > C++ tutorial may be helpful. This may be relevant for (1). > > Thanks, > Robert > > > -- > Mailing list: https://launchpad.net/~ubuntu-phone > Post to : ubuntu-phone@lists.launchpad.net > Unsubscribe : https://launchpad.net/~ubuntu-phone > More help : https://help.launchpad.net/ListHelp >
-- Mailing list: https://launchpad.net/~ubuntu-phone Post to : ubuntu-phone@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-phone More help : https://help.launchpad.net/ListHelp