Ticket #12334: 0001-Added-check-of-write-access-of-selected-output-folde.patch

File 0001-Added-check-of-write-access-of-selected-output-folde.patch, 1.4 KB (added by vivek-roy, 7 years ago)

Fixed long lines as suggested by Barrett

  • src/apps/mediaconverter/MediaConverterWindow.cpp

    From a80eb2b4479f8b793a55882acab7e98f236f2410 Mon Sep 17 00:00:00 2001
    From: Vivek Roy <vivekroyandroid@gmail.com>
    Date: Sun, 5 Mar 2017 21:15:55 +0530
    Subject: [PATCH] Added check of write-access of selected output folder
    
    ---
     src/apps/mediaconverter/MediaConverterWindow.cpp | 16 +++++++++++++++-
     1 file changed, 15 insertions(+), 1 deletion(-)
    
    diff --git a/src/apps/mediaconverter/MediaConverterWindow.cpp b/src/apps/mediaconverter/MediaConverterWindow.cpp
    index 7fee41f..bb2ead7 100644
    a b  
    99
    1010#include <stdio.h>
    1111#include <string.h>
     12#include <unistd.h>
    1213
    1314#include <Alert.h>
    1415#include <Application.h>
    MediaConverterWindow::_CreateMenu()  
    10051006void
    10061007MediaConverterWindow::_SetOutputFolder(BEntry entry)
    10071008{
    1008     fOutputDir.SetTo(&entry);
     1009    BPath path;
     1010    entry.GetPath(&path);
     1011    if (access(path.Path(), W_OK) != -1) {
     1012        fOutputDir.SetTo(&entry);
     1013    } else {
     1014        BString errorString(B_TRANSLATE("Error writing to location: %strPath%."
     1015            " Defaulting to location: /boot/home"));
     1016        errorString.ReplaceFirst("%strPath%", path.Path());
     1017        BAlert* alert = new BAlert(B_TRANSLATE("Error"),
     1018            errorString.String(), B_TRANSLATE("OK"));
     1019        alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
     1020        alert->Go();
     1021        fOutputDir.SetTo("/boot/home")
     1022    }
    10091023    TruncateOutputFolderPath();
    10101024}