Ticket #9053: commit-4910372.patch

File commit-4910372.patch, 1.1 KB (added by przemub, 12 years ago)
  • src/apps/webpositive/DownloadWindow.cpp

    commit 491037243c7458ed5df337229e26e23cca00adc9
    Author: Przemysław Buczkowski <przemub@yahoo.pl>
    Date:   Mon Oct 8 17:30:16 2012 +0200
    
        Create a download directory after its change in Web+
        
        It prevents crash due to non-existence of a download folder.
        
        Signed-off-by: Przemysław Buczkowski <przemub@yahoo.pl>
    
    diff --git a/src/apps/webpositive/DownloadWindow.cpp b/src/apps/webpositive/DownloadWindow.cpp
    index dee9867..b7fd5b0 100644
    a b  
    3333#include <Button.h>
    3434#include <Catalog.h>
    3535#include <ControlLook.h>
     36#include <Directory.h>
    3637#include <Entry.h>
    3738#include <File.h>
    3839#include <FindDirectory.h>
    DownloadWindow::MessageReceived(BMessage* message)  
    309310                && string == kSettingsKeyDownloadPath
    310311                && message->FindString("value", &string) == B_OK) {
    311312                fDownloadPath = string;
     313               
     314                // Create a directory if it does not exist
     315                BDirectory directory;
     316                directory.CreateDirectory(fDownloadPath, NULL);
    312317            }
    313318            break;
    314319        }