Do QSettings handle windows registry changes? - qt

I´m using settings to read/write values inside windows registry. I would like to be able to reload those values if changes happened.
Actually, this kind of event can be handled with: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724892(v=vs.85).aspx (didn´t test it).
I don´t want to use windows specific code. Then, do QSettings handle registry changes?

Related

How QReadWriteLock works properly

I had a server programm that takes settings from a file. I tried to lock while reading it using QReadWriteLock class allocated dynamically in my own class and released to free store in destructor of my class object of which exists in main(). My major was to lock it, so that if launched, the second time .exe of the programm it couldn't get access so that I could have had a Singleapplication Compiling shows no error but when I launch my server from second .exe (yet the first functioning) it also has a access to settings. What is my mistake or I'm not suppose to utilize QReadWriteLock in this case, due to it's related to threads only? Not to seperate executables?
The QReadWriteLock is used to synchronize producer/consumer-like threads within a single application. If you want to prevent starting the same executable more than once, you'd use a PID-file or something alike. An other option is to use the QtSingleApplication code from the QtSolutions-plugin: Qt: Best practice for a single instance app protection.

Creating a database in the blackberry device when the app is installed

I want to create a database on my blackberry device when my app is installed. I did not find any event (e.g. onInstalled) so that i can create my databse on this event when the app is installed.
Apparently there is a method DatabaseFactory.exists() which i can use to check if the database exists or not. But i do not want to check for this every time. I want to create the database when my app is installed and when the app is un-installed then the database should also get deleted.
Thanks
As far as I know RIM API SDK does not provide mechanism to catch install/uninstall events.
And even the database is once created it can be deleted/damaged via the filesystem. For instance user deletes database files from the media-card or from the device memory. Just because user does not know what these files contain and assumes these as temporary or something else.
It is a good approach to check the database presence before starting work with it. Otherwise user may get blank white screen with text "Exception 1234" and some additional text, or may get a popup with strange message, like "Error: FileNotFoundException...".
See the SQLiteDemo in the blackberry samples demo then you can get solution.

File write permission to application directory in windows 7 in Flex

I am creating an AIR application using Flex. In it I use a file in application directory to store some data in it.Its working very well to read and write data to this file with various OS except windows 7. In windows 7 it is not working. May be its a permission problem.
How can i write file in the application directory with Windows 7 ?
Thanks
Arif
Have you tried using the user directory instead of the application directory to store data?
Instead of applicationDirectory use applicationStorageDirctory. Your app should always have access to write tot he latter.
Is User Account Control active on the system? Air may not be triggering a UAC prompt properly, but if it is on, depending on the access restrictions, you will need to have the user ok any changes to the Program Files folder(s).
Edit
Turns out you never have the ability to write to the path associated with File.applicationDirectory, at least as far as the documentation is concerned.

Can't get PHP session save handler sqlite working

I have set up a little server on an old XP Pro box, with php 5.3.1.
In order to use it as a test box to mirror our hosted site, I need to get sqlite sessions working.
While sqlite is definitely there in phpinfo(), I can't seem to get php.ini to use it as a save handler:
Registered save handlers - files user
In php.ini, I've got
session.save_handler = sqlite
session.save_path = "D:\temp\php-session"
A good question to have answered first is, does the SQLite plugin you're using expose itself as sqlite or sqlite3?
You may try using sqlite3 as your session.save_handler value. Make sure you start your sessions, too!
if you want to use SQLite as a session handler, two options :
It's registered as a session handler (you can check this in the phpinfo() > Registered save handlers). Usually it's "User, files" which means that you can't use SQLite as a session handler directly.
You can write your own session handler by implementing session_ set_save _handler(). An example is given in the manual.
The problem turned out to be the system variable PHPRC not being read for some reason. My php.ini was being ignored.
Found this out by going thru and redoing EVERYTHING over again to make sure I hadn't misconfigured something somewhere. I didn't see any difference between the old and new var, but after a reboot things were suddenly coming up roses.
Thanks to everyone who offered suggestions!

ASP.Net page accessing wrong registry?

I'm trying to read values from the registry but somehow I seem to be getting the wrong registry. I can't read from any keys that I create and changing the values of keys that I am able to get seems to have no effect.
I'm using Registry.GetValue to get the values and it is returning either null for my keys or the original value for the keys that I changed.
I'm reading the values in an aspx page. The OS is Windows Server 2003 SP2 64bit. IIS is running in 32bit. I'm not sure what other information might be relevant here.
Any information on how this can happen and what I can do about it is appreciated.
If IIS is running in 32-bit mode on a 64-bit server, it will be accessing the WOW64 registry. Try setting values under HKLM\Software\Wow6432Node instead, which will map to a 32-bit process's view of HKLM\Software
Make sure you're not writing to HKEY_CURRENT_USER. Those are for settings localized to the logged in user. Your ASP.NET app isn't going to be able to access your registry settings.
I'm not sure exactly, but I'd suggest trying to place your keys in HKEY_LOCAL_MACHINE/Software. That's where the system wide (like your asp.net app) settings go.

Resources