removed the use of QFileDialog
This commit is contained in:
parent
8f6aa950cd
commit
e8862a3811
22 changed files with 224 additions and 164 deletions
|
|
@ -85,23 +85,9 @@ ImportController::ImportController(const QSharedPointer<ServersModel> &serversMo
|
|||
#endif
|
||||
}
|
||||
|
||||
void ImportController::extractConfigFromFile()
|
||||
void ImportController::extractConfigFromFile(const QString &fileName)
|
||||
{
|
||||
QString fileName = FileUtilites::getFileName(Q_NULLPTR, tr("Open config file"),
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),
|
||||
"*.vpn *.ovpn *.conf");
|
||||
QFile file(fileName);
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
CFURLRef url = CFURLCreateWithFileSystemPath(
|
||||
kCFAllocatorDefault,
|
||||
CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar *>(fileName.unicode()), fileName.length()),
|
||||
kCFURLPOSIXPathStyle, 0);
|
||||
|
||||
if (!CFURLStartAccessingSecurityScopedResource(url)) {
|
||||
qDebug() << "Could not access path " << QUrl::fromLocalFile(fileName).toString();
|
||||
}
|
||||
#endif
|
||||
QFile file(FileUtilites::getFileName(fileName));
|
||||
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
QString data = file.readAll();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue