# HG changeset patch # User sheepluva # Date 1319491441 -7200 # Node ID 8e3f006b9b1ec1b8b68c8196b65a90ed0dd4cec5 # Parent d88e7f6cf49996e0ba1871aaaa6f8ccedbcce1f8 this should fix stylesheet importing on windows, but we'll see diff -r d88e7f6cf499 -r 8e3f006b9b1e QTfrontend/ui/widget/chatwidget.cpp --- a/QTfrontend/ui/widget/chatwidget.cpp Mon Oct 24 22:46:35 2011 +0200 +++ b/QTfrontend/ui/widget/chatwidget.cpp Mon Oct 24 23:24:01 2011 +0200 @@ -762,17 +762,24 @@ if (event->mimeData()->hasUrls()) { QList urls = event->mimeData()->urls(); - QString url = urls[0].toString(); if (urls.count() == 1) - if (url.contains(QRegExp("^file://.*\\.css$"))) + { + QUrl url = urls[0]; + + static QRegExp localFileRegExp("file://.*\\.css$"); + localFileRegExp.setCaseSensitivity(Qt::CaseInsensitive); + + if (url.toString().contains(localFileRegExp)) event->acceptProposedAction(); + } } } void HWChatWidget::dropEvent(QDropEvent * event) { const QString path(event->mimeData()->urls()[0].toString()); - QFile file(QString(path).remove(QRegExp("^file://"))); + + QFile file(event->mimeData()->urls()[0].toLocalFile()); if (file.exists() && (file.open(QIODevice::ReadOnly | QIODevice::Text))) { @@ -781,8 +788,7 @@ while (!in.atEnd()) { QString line = in.readLine(); - if(!line.isEmpty()) - style.append(line); + style.append(line + "\n"); } setStyleSheet(style);