Solid
tutorial4.cpp
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2007 Christopher Blauvelt <cblauvelt@gmail.com> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 00018 */ 00019 00020 //QT specific includes 00021 #include <QList> 00022 00023 //solid specific includes 00024 #include <solid/device.h> 00025 #include <solid/networking.h> 00026 00027 //kde specific includes 00028 #include <kcomponentdata.h> 00029 #include <kcmdlineargs.h> 00030 #include <klocale.h> 00031 #include <kdebug.h> 00032 00033 #include <iostream> 00034 00035 using namespace std; 00036 00037 int main(int args, char **argv) 00038 { 00039 KComponentData data("tutorial4"); 00040 00041 //test to see if networking is enabled on the system 00042 if(Solid::Networking::status() == Solid::Networking::Connected) 00043 { 00044 kDebug() << "Networking is enabled. Feel free to go online!"; 00045 } 00046 else 00047 { 00048 kDebug() << "Network not available."; 00049 } 00050 return 0; 00051 } 00052 00053 #include "tutorial4.moc"