~ubuntu-filemanager-dev/ubuntu-filemanager-app/trunk

« back to all changes in this revision

Viewing changes to src/plugin/folderlistmodel/smb/qsambaclient/src/smbiteminfo.cpp

Improved DirItemInfo and descendant classes:
* added DirItemInfo::setFile(const QString& newUrl) to change the current Item information
* fixed operator =.

Approved by Jenkins Bot, Arto Jalkanen.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
        url.setPath(f.canonicalFilePath());
137
137
        smb_path = url.toString();
138
138
    }
139
 
    smb_path += QDir::separator() + file;
 
139
    if (!file.isEmpty())
 
140
    {
 
141
        smb_path += QDir::separator() + file;
 
142
    }
140
143
    SmbItemInfo *other  = new SmbItemInfo( LocationUrl::SmbURL + DirItemInfo::removeExtraSlashes(smb_path),
141
144
                                           m_smb);
142
145
    if (other->isValid())
143
146
    {
144
147
        *this = *other;
145
148
    }
146
 
    else
147
 
    {
148
 
        delete other;
149
 
    }
 
149
 
 
150
    delete other; //always delete
150
151
}
151
152
 
152
 
 
153
 
void SmbItemInfo::setAsShare()
 
153
void SmbItemInfo::setFile(const QString &smb_path)
154
154
{
155
 
    d_ptr->_isNetworkShare = true;
 
155
    return setFile(smb_path, QLatin1String(0));
156
156
}
 
157