Skip to content
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

Option to ask if file should be overwritten #86

Open
detzt opened this issue Nov 13, 2015 · 1 comment
Open

Option to ask if file should be overwritten #86

detzt opened this issue Nov 13, 2015 · 1 comment

Comments

@detzt
Copy link

detzt commented Nov 13, 2015

I don't want to auto override every file so I leave this in the settings unchecked.
Sometimes I would like to override a file so I have to either check that temporarily or even have to delete the file and download it again if I don't want to have every file overwritten.
So here is my suggestion:

Add the option to ask for every updated file, if it sould be overwritten or not.

The selection doesn't have to be saved, just a littly message to choose.

@detzt
Copy link
Author

detzt commented Jan 31, 2016

I'm currently not good enough at C++, but this would only need to change the calculation of downloadFile in browser.cpp around line 183 to something like:

bool downloadFile = true;
bool modified = QFileInfo(directory, filename).lastModified().toMSecsSinceEpoch()/1000 < currentElement->data(dateRole).toDateTime().toMSecsSinceEpoch()/1000;
if(directory.exists(filename))
{
    if(modified)
    {
        downloadFile = options->isOverrideFilesCheckBoxChecked();
        if(options->isAskForOverrideFilesCheckBoxChecked()) // Entsprechende CheckBox muss dem UI hinzugefuegt werden
        {
            // downloadFile = Utils::confirmMessageBox("Soll die Datei "+info+" ueberschrieben werden?");
            // In der obigen Zeile soll nachgefragt werden, allerdings kenne ich die Befehle nicht.
        }
    }
    else
    {
        downloadFile = false; // Datei unveraendert
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants