Update 'Cache, config local files'
parent
a672919676
commit
3b836ef3ea
@ -8,13 +8,13 @@ QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
|
|||||||
```
|
```
|
||||||
Whis is a standard Qt way to find a writable location for cache files. Nowadays on GNU+Linux systems it creates a folder in your `~/.cache` directory application name. So, on my machine it creates a folder under following path
|
Whis is a standard Qt way to find a writable location for cache files. Nowadays on GNU+Linux systems it creates a folder in your `~/.cache` directory application name. So, on my machine it creates a folder under following path
|
||||||
```
|
```
|
||||||
~/.cache/squawk
|
~/.cache/macaw.me/squawk
|
||||||
```
|
```
|
||||||
There are going to be several subfolders there: one for each of your account and a folder for localPath/remoteURLs database used im my file upload caching method.
|
There are going to be several subfolders there: one for each of your account and a folder for localPath/remoteURLs database used im my file upload caching method.
|
||||||
|
|
||||||
Inside each of account folders there going to be your avatar and a folder for each of your contacts and MUCs. There are 2 complementary database files there `data.mdb` and `lock.mdb`, this is where Squawk stores message history with this contact. In contact folders there is going to be avatar, and in MUC folders there is going to be avatar for MUC (called the same way the MUC is called to prevent overlaping with some possible genius desiding that "avatar" is a darn good nick name) and many avatars for participants each under their nickname in that MUC. If participant didn't had an avatar Squawk creates one basing on the first letter of their Jabber id or on their nick.
|
Inside each of account folders there going to be your avatar and a folder for each of your contacts and MUCs. There are 2 complementary database files there `data.mdb` and `lock.mdb`, this is where Squawk stores message history with this contact. In contact folders there is going to be avatar, and in MUC folders there is going to be avatar for MUC (called the same way the MUC is called to prevent overlaping with some possible genius desiding that "avatar" is a darn good nick name) and many avatars for participants each under their nickname in that MUC. If participant didn't had an avatar Squawk creates one basing on the first letter of their Jabber id or on their nick.
|
||||||
|
|
||||||
You can safely remove account or contact directories in cache, it's just goung to clear your local history, and if your server stores it - you're going to get it again with the avatars. It's not a good idea to remove 'fileURLStorage' storage and keeping account folders - this way you might break downloading files. You see, every time Squawk gets a new message via history or in a real time it checks if the message has a URL for the file you can download. Information of messages are stored in fileURLStorage, so when you try to download it Squawk checks which other messages use the same url and downloading it once assign the local path to all messages that are affilated with that file. When you remove your local file Squawk also detects which messages are going to be affected by this action and when if fails to paint the attachment you have already downloaded - it marks all messages with the same local file path as undownloaded. The best way to clear your cache is to remove the whole `~/.cache/squawk` folder. You can also remove each of `~/.cache/squawk/<accountName>` folders but please don't touch `~/.cache/squawk/fileURLStorage`.
|
You can safely remove account or contact directories in cache, it's just goung to clear your local history, and if your server stores it - you're going to get it again with the avatars. It's not a good idea to remove 'fileURLStorage' storage and keeping account folders - this way you might break downloading files. You see, every time Squawk gets a new message via history or in a real time it checks if the message has a URL for the file you can download. Information of messages are stored in fileURLStorage, so when you try to download it Squawk checks which other messages use the same url and downloading it once assign the local path to all messages that are affilated with that file. When you remove your local file Squawk also detects which messages are going to be affected by this action and when if fails to paint the attachment you have already downloaded - it marks all messages with the same local file path as undownloaded. The best way to clear your cache is to remove the whole `~/.cache/macaw.me/squawk` folder. You can also remove each of `~/.cache/macaw.me/squawk/<accountName>` folders but please don't touch `~/.cache/macaw.me/squawk/fileURLStorage`.
|
||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
Squawk stores detects where to store downloads using following code
|
Squawk stores detects where to store downloads using following code
|
||||||
@ -28,17 +28,23 @@ On my machine it creates a folder there
|
|||||||
```
|
```
|
||||||
In this folder you will find many subfolders named after Jabber IDs of conversations you got this file from. I'm not quite sure yet if it's comfortable enought and probably going to modify this behaviour in future. It is safe to rename move or remove files from there - Squawk will detect that the file no longer exist under the previous name and will offer you to download it again in each message it happened to be used by. If by any chance the new downloading file name overlaps with existing one Squawk tries to add (n) to it, before suffix like `file.tar.gz` then `file(1).tar.gz` then `file(2).tar.gz` and so on.
|
In this folder you will find many subfolders named after Jabber IDs of conversations you got this file from. I'm not quite sure yet if it's comfortable enought and probably going to modify this behaviour in future. It is safe to rename move or remove files from there - Squawk will detect that the file no longer exist under the previous name and will offer you to download it again in each message it happened to be used by. If by any chance the new downloading file name overlaps with existing one Squawk tries to add (n) to it, before suffix like `file.tar.gz` then `file(1).tar.gz` then `file(2).tar.gz` and so on.
|
||||||
|
|
||||||
|
There is a way to change this directory from settings menu.
|
||||||
|
|
||||||
## Config
|
## Config
|
||||||
### Where do I find config
|
### Where do I find config
|
||||||
Squawk uses [QSettings](https://doc.qt.io/qt-5/qsettings.html) framework to store configuration files. Nowadays on GNU+Linux systems it creates a folder in your `~/.config` directory with the organization name and a file `<application_name>.conf` file in it. For now the name of application is squawk, and it has no organization, so, it's unset. By default Qt on my system creates a file under following path:
|
Squawk uses [QSettings](https://doc.qt.io/qt-5/qsettings.html) framework to store configuration files. Nowadays on GNU+Linux systems it creates a folder in your `~/.config` directory with the organization name and a file `<application_name>.conf` file in it. For now the name of application is squawk, and it has no organization, so, it's unset. By default Qt on my system creates a file under following path:
|
||||||
```
|
```
|
||||||
~/.config/Unknown\ Organization/squawk.conf
|
~/.config/macaw.me/squawk.conf
|
||||||
```
|
```
|
||||||
The backslash is there for you to copy paste it into your console, it shields the space.
|
|
||||||
|
|
||||||
### What is written in the config
|
### What is written in the config
|
||||||
Basically I never intended the user to manually edit the config. It is not used to configurate the app but to store there some persistent options user set up during the usage. Let's see what the config looks like
|
Basically I never intended the user to manually edit the config. It is not used to configurate the app but to store there some persistent options user set up during the usage. Let's see what the config looks like
|
||||||
```
|
```
|
||||||
|
[General]
|
||||||
|
downloadsPath=/home/user/Downloads/squawk
|
||||||
|
style="system"
|
||||||
|
theme="system"
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
accounts\1\login=blue
|
accounts\1\login=blue
|
||||||
accounts\1\name=Blue
|
accounts\1\name=Blue
|
||||||
@ -66,7 +72,13 @@ window\geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0u\0\0\0[\0\0\x4\x30\0\0
|
|||||||
window\state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x3\xbc\0\0\x2\xda\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\0)
|
window\state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x3\xbc\0\0\x2\xda\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\0)
|
||||||
```
|
```
|
||||||
|
|
||||||
As you can see it has 2 sections: core and ui.
|
As you can see it has 3 sections: General core and ui.
|
||||||
|
|
||||||
|
### [General]
|
||||||
|
Here is where the settings you can set with settings menu are stored. Surely it will be many times rewritten, but for now here they are:
|
||||||
|
* downloadsPath - a path to your downloads directory. Try to modify it only with GUI - I move the directory of old settings to the new place upon modification, if the squawk is started but the folder is out of place the database is probably going to be messed up, but nothing critical, you might need to download all your files from dialogs again
|
||||||
|
* style - a style of the app one of following: breeze/oxygen/fusion and others installed in your system. The magic word `"system"` means that the style should follow system. If this option is abscent - squawk will follow system style as well
|
||||||
|
* theme - a color scheme of the app. It's supported only if squawk was compiled with support of `KDE Frameworks Config` and `KDE Frameworks Config Widgets`. Fo you to use the theme it must be installed to your system, system color qt schemes are usually located in `QStandardPaths::GenericDataLocation + "/color-schemes"`, for example `/usr/share/color-schemes/BreezeDark.colors`. Settings menu allowes you to select a palette from this files.
|
||||||
|
|
||||||
#### [core]
|
#### [core]
|
||||||
The only variable now in core is the list of accounts. These are accounts user set up to have in the app. As you can see my config has 2 accounts.
|
The only variable now in core is the list of accounts. These are accounts user set up to have in the app. As you can see my config has 2 accounts.
|
||||||
|
Loading…
Reference in New Issue
Block a user