Changeset 13262 in osm for applications/editors/josm/plugins
- Timestamp:
- 2009-01-19T17:19:55+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/wmsplugin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/Makefile
r12609 r13262 1 1 #!/usr/bin/make 2 3 MOC=moc 4 #MOC=/usr/share/qt4/bin/moc 5 CFLAGS = 2 6 LDFLAGS = `pkg-config --libs --cflags QtCore QtGui QtWebKit` 3 7 4 compile: webkit-image.cpp webkit-image.h5 g++ -W -o webkit-image -I/usr/include/qt4/ -O2$(LDFLAGS) webkit-image.cpp8 webkit-image: webkit-image.cpp webkit-image.h 9 g++ -W -o $@ -O2 $(CFLAGS) $(LDFLAGS) webkit-image.cpp 6 10 7 11 webkit-image.h: webkit-image.cpp 8 /usr/share/qt4/bin/moc webkit-image.cpp >webkit-image.h12 $(MOC) webkit-image.cpp >$@ 9 13 10 14 clean: -
applications/editors/josm/plugins/wmsplugin/webkit-image.cpp
r12588 r13262 13 13 #include <QtWebKit/QWebPage> 14 14 #include <QtWebKit/QWebFrame> 15 #include <QtNetwork/QNetworkProxy> 16 #include <QtCore/QProcess> 15 17 16 18 /* using mingw to set binary mode */ … … 70 72 Save * s = new Save(page); 71 73 74 QStringList environment = QProcess::systemEnvironment(); 75 int idx = environment.indexOf(QRegExp("http_proxy=.*")); 76 if(idx != -1) 77 { 78 QString proxyHost; 79 int proxyPort = 8080; 80 QStringList tmpList = environment.at(idx).split("="); 81 QStringList host_port = tmpList.at(1).split(":"); 82 proxyHost = host_port.at(0); 83 if(host_port.size() == 2) 84 { 85 bool ok; 86 int port = host_port.at(1).toInt(&ok); 87 if(ok) 88 proxyPort = port; 89 } 90 91 QNetworkProxy proxy; 92 proxy.setType(QNetworkProxy::HttpCachingProxy); 93 proxy.setHostName(proxyHost); 94 proxy.setPort(proxyPort); 95 page->networkAccessManager()->setProxy(proxy); 96 } 97 72 98 QObject::connect(page, SIGNAL(loadFinished(bool)), s, SLOT(loaded(bool))); 73 99 QObject::connect(s, SIGNAL(finish(void)), &a, SLOT(quit()));
Note:
See TracChangeset
for help on using the changeset viewer.