Example #1
0
int Folder::newFolder(string folderName){
    string folderPath = this->getPath() + '/' + folderName;

    if (mkdir(folderPath.c_str(), 0777) == -1){
        cerr << "erreur de création du dossier" << endl;
        return -1;
    }
    else{
        Folder *logicalFolder = new Folder(folderName, this->getPath());
        this->addFolder(logicalFolder);
        this->sort();
        int position = findFolderPosition(folderName);
        qItem->insertRow(position, logicalFolder->getQItem());
        return 0;
    }
}