Commit d7624e78 authored by Antonio Rojas's avatar Antonio Rojas
Browse files

Port knetattach away from kdelibs4support

parent 5c13d69f
...@@ -9,7 +9,7 @@ add_executable(knetattach ${knetattach_SRCS}) ...@@ -9,7 +9,7 @@ add_executable(knetattach ${knetattach_SRCS})
target_compile_definitions(knetattach PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") target_compile_definitions(knetattach PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
target_link_libraries(knetattach KF5::KIOWidgets KF5::KDELibs4Support) target_link_libraries(knetattach KF5::KIOWidgets KF5::I18n KF5::Codecs)
install(TARGETS knetattach DESTINATION ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS knetattach DESTINATION ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
...@@ -22,19 +22,15 @@ ...@@ -22,19 +22,15 @@
#include <QVariant> #include <QVariant>
#include <KIO/NetAccess> #include <KIO/StatJob>
#include <KJobWidgets>
#include <KMessageBox> #include <KMessageBox>
#include <QIcon> #include <QIcon>
#include <KLocale>
#include <KGlobalSettings>
#include <KConfig> #include <KConfig>
#include <KConfigGroup> #include <KConfigGroup>
#include <KStandardDirs>
#include <KDirNotify> #include <KDirNotify>
#include <KCharsets> #include <KCharsets>
#include <KDebug>
#include <KRun> #include <KRun>
#include <KGlobal>
#include <QDesktopServices> #include <QDesktopServices>
#include <QTextCodec> #include <QTextCodec>
...@@ -228,9 +224,7 @@ bool KNetAttach::validateCurrentPage() ...@@ -228,9 +224,7 @@ bool KNetAttach::validateCurrentPage()
QString name = _connectionName->text().trimmed(); QString name = _connectionName->text().trimmed();
if (_createIcon->isChecked()) { if (_createIcon->isChecked()) {
KGlobal::dirs()->addResourceType("remote_entries", "data", "remoteview"); QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/remoteview/");
QString path = KGlobal::dirs()->saveLocation("remote_entries");
path += name + QStringLiteral(".desktop"); path += name + QStringLiteral(".desktop");
KConfig _desktopFile( path, KConfig::SimpleConfig ); KConfig _desktopFile( path, KConfig::SimpleConfig );
KConfigGroup desktopFile(&_desktopFile, "Desktop Entry"); KConfigGroup desktopFile(&_desktopFile, "Desktop Entry");
...@@ -289,12 +283,9 @@ void KNetAttach::updatePort(bool encryption) ...@@ -289,12 +283,9 @@ void KNetAttach::updatePort(bool encryption)
bool KNetAttach::doConnectionTest(const QUrl& url) bool KNetAttach::doConnectionTest(const QUrl& url)
{ {
KIO::UDSEntry entry; KIO::StatJob *job = KIO::stat(url);
if (KIO::NetAccess::stat(url, entry, this)) { KJobWidgets::setWindow(job, this);
// Anything to test here? return job->exec();
return true;
}
return false;
} }
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="KButtonGroup" name="buttonGroup1"> <widget class="QGroupBox" name="buttonGroup1">
<property name="title"> <property name="title">
<string/> <string/>
</property> </property>
...@@ -382,12 +382,6 @@ ...@@ -382,12 +382,6 @@
</widget> </widget>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>KButtonGroup</class>
<extends>QGroupBox</extends>
<header>kbuttongroup.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>KLineEdit</class> <class>KLineEdit</class>
<extends>QLineEdit</extends> <extends>QLineEdit</extends>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment